Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
27ba3494
Commit
27ba3494
authored
3 years ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
[Logger] Updated LoggerStats, now they are reset after each stats log
parent
7b1bfe34
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/logger/Logger.cpp
+15
-9
15 additions, 9 deletions
src/shared/logger/Logger.cpp
src/shared/logger/Logger.h
+5
-5
5 additions, 5 deletions
src/shared/logger/Logger.h
with
20 additions
and
14 deletions
src/shared/logger/Logger.cpp
+
15
−
9
View file @
27ba3494
...
...
@@ -105,7 +105,6 @@ bool Logger::start()
}
started
=
true
;
stats
.
logNumber
=
fileNumber
;
return
true
;
}
...
...
@@ -139,10 +138,23 @@ int Logger::getCurrentLogNumber() { return fileNumber; }
string
Logger
::
getCurrentFileName
()
{
return
getFileName
(
fileNumber
);
}
LoggerStats
Logger
::
getLoggerStats
()
{
return
stats
;
}
LoggerStats
Logger
::
getLoggerStats
()
{
stats
.
timestamp
=
TimestampTimer
::
getInstance
().
getTimestamp
();
stats
.
logNumber
=
fileNumber
;
return
stats
;
}
bool
Logger
::
isStarted
()
const
{
return
started
;
}
void
Logger
::
logStats
()
{
log
(
getLoggerStats
());
// Reset the logger stats after they have been logger
stats
=
LoggerStats
();
}
Logger
::
Logger
()
{
// Allocate the records
...
...
@@ -346,10 +358,4 @@ LoggerResult Logger::logImpl(const char* name, const void* data,
return
LoggerResult
::
Queued
;
}
void
Logger
::
logStats
()
{
stats
.
timestamp
=
TimestampTimer
::
getInstance
().
getTimestamp
();
log
(
stats
);
}
}
// namespace Boardcore
This diff is collapsed.
Click to expand it.
src/shared/logger/Logger.h
+
5
−
5
View file @
27ba3494
...
...
@@ -115,6 +115,11 @@ public:
template
<
typename
T
>
LoggerResult
log
(
const
T
&
t
);
/**
* @brief Log logger stats using the logger itself.
*/
void
logStats
();
private:
Logger
();
...
...
@@ -143,11 +148,6 @@ private:
*/
LoggerResult
logImpl
(
const
char
*
name
,
const
void
*
data
,
unsigned
int
size
);
/**
* @brief Log logger stats using the logger itself.
*/
void
logStats
();
static
constexpr
unsigned
int
maxFilenameNumber
=
100
;
///< Limit on files
static
constexpr
unsigned
int
maxRecordSize
=
512
;
///< Limit on data
static
constexpr
unsigned
int
numRecords
=
512
;
///< Size of record queues
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment