Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
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
Service Desk
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
MacroFake
Tor
Commits
bdde4579
Commit
bdde4579
authored
3 years ago
by
David Goulet
Browse files
Options
Downloads
Patches
Plain Diff
relay: Code and objects to initialize metrics store
Signed-off-by:
David Goulet
<
dgoulet@torproject.org
>
parent
0cf25fd3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/feature/relay/relay_metrics.c
+7
-0
7 additions, 0 deletions
src/feature/relay/relay_metrics.c
src/feature/relay/relay_metrics.h
+24
-0
24 additions, 0 deletions
src/feature/relay/relay_metrics.h
with
31 additions
and
0 deletions
src/feature/relay/relay_metrics.c
+
7
−
0
View file @
bdde4579
...
...
@@ -17,6 +17,13 @@
#include
"feature/relay/relay_metrics.h"
/** The base metrics that is a static array of metrics added to the metrics
* store.
*
* The key member MUST be also the index of the entry in the array. */
static
const
relay_metrics_entry_t
base_metrics
[]
=
{};
static
const
size_t
num_base_metrics
=
ARRAY_LENGTH
(
base_metrics
);
/** The only and single store of all the relay metrics. */
static
metrics_store_t
*
the_store
;
...
...
This diff is collapsed.
Click to expand it.
src/feature/relay/relay_metrics.h
+
24
−
0
View file @
bdde4579
...
...
@@ -10,6 +10,30 @@
#define TOR_FEATURE_RELAY_RELAY_METRICS_H
#include
"lib/container/smartlist.h"
#include
"lib/metrics/metrics_common.h"
#ifdef RELAY_METRICS_ENTRY_PRIVATE
/** Metrics key for each reported metrics. This key is also used as an index in
* the base_metrics array. */
typedef
enum
{
/* XXX So code compiles. */
PLACEHOLDER
=
0
,
}
relay_metrics_key_t
;
/** The metadata of a relay metric. */
typedef
struct
relay_metrics_entry_t
{
/* Metric key used as a static array index. */
relay_metrics_key_t
key
;
/* Metric type. */
metrics_type_t
type
;
/* Metrics output name. */
const
char
*
name
;
/* Metrics output help comment. */
const
char
*
help
;
}
relay_metrics_entry_t
;
#endif
/* RELAY_METRICS_ENTRY_PRIVATE */
/* Init. */
void
relay_metrics_init
(
void
);
...
...
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