Skip to content

Commit 92a16b9

Browse files
committed
encode_opentelemetry: tests: Make a generic opts instead of cutoff specific one
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent f6f0e93 commit 92a16b9

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/cmetrics/cmt_encode_opentelemetry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ struct cmt_opentelemetry_context
4545
int64_t cutoff_threshold;
4646
};
4747

48-
struct cmt_opentelemetry_context_cutoff_opts
48+
struct cmt_opentelemetry_context_opts
4949
{
50-
int use_cutoff;
51-
int64_t cutoff_threshold;
50+
int use_cutoff;
51+
int64_t cutoff_threshold;
5252
};
5353

5454
cfl_sds_t cmt_encode_opentelemetry_create(struct cmt *cmt);
5555
cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff(struct cmt *cmt, int use_cutoff);
5656
cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff_opts(struct cmt *cmt,
57-
struct cmt_opentelemetry_context_cutoff_opts *opts);
57+
struct cmt_opentelemetry_context_opts *opts);
5858

5959
void cmt_encode_opentelemetry_destroy(cfl_sds_t text);
6060

src/cmt_encode_opentelemetry.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void destroy_opentelemetry_context(
257257
struct cmt_opentelemetry_context *context);
258258

259259
static struct cmt_opentelemetry_context *initialize_opentelemetry_context(
260-
struct cmt *cmt, struct cmt_opentelemetry_context_cutoff_opts *opts);
260+
struct cmt *cmt, struct cmt_opentelemetry_context_opts *opts);
261261

262262
static inline Opentelemetry__Proto__Common__V1__AnyValue *cfl_variant_to_otlp_any_value(struct cfl_variant *value);
263263
static inline Opentelemetry__Proto__Common__V1__KeyValue *cfl_variant_kvpair_to_otlp_kvpair(struct cfl_kvpair *input_pair);
@@ -2138,7 +2138,7 @@ static Opentelemetry__Proto__Resource__V1__Resource *
21382138
}
21392139

21402140
static struct cmt_opentelemetry_context *initialize_opentelemetry_context(
2141-
struct cmt *cmt, struct cmt_opentelemetry_context_cutoff_opts *opts)
2141+
struct cmt *cmt, struct cmt_opentelemetry_context_opts *opts)
21422142
{
21432143
struct cfl_kvlist *resource_metrics_root;
21442144
struct cfl_kvlist *scope_metrics_root;
@@ -2532,7 +2532,7 @@ static cfl_sds_t render_opentelemetry_context_to_sds(
25322532
}
25332533

25342534
cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff_opts(struct cmt *cmt,
2535-
struct cmt_opentelemetry_context_cutoff_opts *opts)
2535+
struct cmt_opentelemetry_context_opts *opts)
25362536
{
25372537
size_t metric_index;
25382538
struct cmt_opentelemetry_context *context;
@@ -2645,7 +2645,7 @@ cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff_opts(struct cmt *cmt,
26452645

26462646
cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff(struct cmt *cmt, int use_cutoff)
26472647
{
2648-
struct cmt_opentelemetry_context_cutoff_opts opts;
2648+
struct cmt_opentelemetry_context_opts opts;
26492649
opts.use_cutoff = use_cutoff;
26502650
opts.cutoff_threshold = CMT_ENCODE_OPENTELEMETRY_CUTOFF_THRESHOLD;
26512651

@@ -2654,7 +2654,7 @@ cfl_sds_t cmt_encode_opentelemetry_create_with_cutoff(struct cmt *cmt, int use_c
26542654

26552655
cfl_sds_t cmt_encode_opentelemetry_create(struct cmt *cmt)
26562656
{
2657-
struct cmt_opentelemetry_context_cutoff_opts opts;
2657+
struct cmt_opentelemetry_context_opts opts;
26582658
opts.use_cutoff = CMT_FALSE;
26592659
opts.cutoff_threshold = CMT_ENCODE_OPENTELEMETRY_CUTOFF_DISABLED;
26602660

tests/encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ void test_opentelemetry_outdated_with_cutoff_opts()
640640
cfl_sds_t payload;
641641
struct cmt *cmt;
642642
uint64_t ts;
643-
struct cmt_opentelemetry_context_cutoff_opts opts;
643+
struct cmt_opentelemetry_context_opts opts;
644644

645645
opts.use_cutoff = CMT_TRUE;
646646
opts.cutoff_threshold = CMT_ENCODE_OPENTELEMETRY_CUTOFF_THRESHOLD;

0 commit comments

Comments
 (0)