geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
geopm_stats_collector.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef GEOPM_STATS_COLLECTOR_H_INCLUDE
7 #define GEOPM_STATS_COLLECTOR_H_INCLUDE
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include "geopm_public.h"
13 #include <stddef.h>
14 
15 struct geopm_request_s;
16 struct geopm_stats_collector_s;
17 
24 };
25 
35 };
36 
38  char name[NAME_MAX];
40 };
41 
43  char host[NAME_MAX];
44  char sample_time_first[NAME_MAX];
46  size_t num_metric;
48 };
49 
66 int GEOPM_PUBLIC
67  geopm_stats_collector_create(size_t num_requests, const struct geopm_request_s *requests,
68  struct geopm_stats_collector_s **collector);
69 
78 int GEOPM_PUBLIC
79  geopm_stats_collector_update(struct geopm_stats_collector_s *collector);
80 
95 int GEOPM_PUBLIC
96  geopm_stats_collector_update_count(const struct geopm_stats_collector_s *collector,
97  size_t *update_count);
98 
119 int GEOPM_PUBLIC
120  geopm_stats_collector_report_yaml(const struct geopm_stats_collector_s *collector,
121  size_t *max_report_size, char *report_yaml);
122 
123 int GEOPM_PUBLIC
124  geopm_stats_collector_report(const struct geopm_stats_collector_s *collector,
125  size_t num_requests, struct geopm_report_s *report);
126 
137 int GEOPM_PUBLIC
138  geopm_stats_collector_reset(struct geopm_stats_collector_s *collector);
139 
145 int GEOPM_PUBLIC
146  geopm_stats_collector_free(struct geopm_stats_collector_s *collector);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 #endif
#define GEOPM_PUBLIC
Definition: geopm_public.h:10
geopm_metric_stats_e
Definition: geopm_stats_collector.h:26
@ GEOPM_METRIC_MEAN
Definition: geopm_stats_collector.h:32
@ GEOPM_METRIC_STD
Definition: geopm_stats_collector.h:33
@ GEOPM_METRIC_MIN
Definition: geopm_stats_collector.h:30
@ GEOPM_METRIC_LAST
Definition: geopm_stats_collector.h:29
@ GEOPM_NUM_METRIC_STATS
Definition: geopm_stats_collector.h:34
@ GEOPM_METRIC_COUNT
Definition: geopm_stats_collector.h:27
@ GEOPM_METRIC_MAX
Definition: geopm_stats_collector.h:31
@ GEOPM_METRIC_FIRST
Definition: geopm_stats_collector.h:28
int GEOPM_PUBLIC geopm_stats_collector_create(size_t num_requests, const struct geopm_request_s *requests, struct geopm_stats_collector_s **collector)
Create a stats collector handle.
Definition: StatsCollector.cpp:211
geopm_sample_stats_e
Definition: geopm_stats_collector.h:18
@ GEOPM_SAMPLE_COUNT
Definition: geopm_stats_collector.h:20
@ GEOPM_SAMPLE_PERIOD_MEAN
Definition: geopm_stats_collector.h:21
@ GEOPM_NUM_SAMPLE_STATS
Definition: geopm_stats_collector.h:23
@ GEOPM_SAMPLE_TIME_TOTAL
Definition: geopm_stats_collector.h:19
@ GEOPM_SAMPLE_PERIOD_STD
Definition: geopm_stats_collector.h:22
int GEOPM_PUBLIC geopm_stats_collector_reset(struct geopm_stats_collector_s *collector)
Reset statistics.
Definition: StatsCollector.cpp:327
int GEOPM_PUBLIC geopm_stats_collector_update_count(const struct geopm_stats_collector_s *collector, size_t *update_count)
Number of updates since last reset.
Definition: StatsCollector.cpp:239
int GEOPM_PUBLIC geopm_stats_collector_free(struct geopm_stats_collector_s *collector)
Release resources associated with collector handle.
Definition: StatsCollector.cpp:340
int GEOPM_PUBLIC geopm_stats_collector_report(const struct geopm_stats_collector_s *collector, size_t num_requests, struct geopm_report_s *report)
Definition: StatsCollector.cpp:284
int GEOPM_PUBLIC geopm_stats_collector_report_yaml(const struct geopm_stats_collector_s *collector, size_t *max_report_size, char *report_yaml)
Create a yaml report.
Definition: StatsCollector.cpp:254
int GEOPM_PUBLIC geopm_stats_collector_update(struct geopm_stats_collector_s *collector)
Update a stat collector with new values.
Definition: StatsCollector.cpp:226
Definition: geopm_stats_collector.h:37
char name[NAME_MAX]
Definition: geopm_stats_collector.h:38
double stats[GEOPM_NUM_METRIC_STATS]
Definition: geopm_stats_collector.h:39
Definition: geopm_stats_collector.h:42
size_t num_metric
Definition: geopm_stats_collector.h:46
char sample_time_first[NAME_MAX]
Definition: geopm_stats_collector.h:44
char host[NAME_MAX]
Definition: geopm_stats_collector.h:43
double sample_stats[GEOPM_NUM_SAMPLE_STATS]
Definition: geopm_stats_collector.h:45
struct geopm_metric_stats_s * metric_stats
Definition: geopm_stats_collector.h:47
Definition: PlatformIO.hpp:19