Skip to content

Commit

Permalink
tests: decoding: Follow the cut off change
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
  • Loading branch information
cosmo0920 committed Sep 25, 2024
1 parent c3d4095 commit 38b1ee4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/decoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@

#include "cmt_tests.h"

static struct cmt *generate_encoder_test_data()
static struct cmt *generate_encoder_test_data_with_timestamp(uint64_t ts)
{
double quantiles[5];
struct cmt_histogram_buckets *buckets;
double val;
struct cmt *cmt;
uint64_t ts;
struct cmt_gauge *g1;
struct cmt_counter *c1;
struct cmt_summary *s1;
struct cmt_histogram *h1;

ts = 0;
cmt = cmt_create();

c1 = cmt_counter_create(cmt, "kubernetes", "network", "load_counter", "Network load counter",
Expand Down Expand Up @@ -124,6 +122,14 @@ static struct cmt *generate_encoder_test_data()
return cmt;
}

static struct cmt *generate_encoder_test_data_now()
{
uint64_t ts = 0;
ts = cfl_time_now();

return generate_encoder_test_data_with_timestamp(ts);
}

void test_opentelemetry()
{
cfl_sds_t reference_prometheus_context;
Expand All @@ -139,7 +145,7 @@ void test_opentelemetry()

cmt_initialize();

cmt = generate_encoder_test_data();
cmt = generate_encoder_test_data_now();
TEST_CHECK(cmt != NULL);

reference_prometheus_context = cmt_encode_prometheus_create(cmt, CMT_TRUE);
Expand Down

0 comments on commit 38b1ee4

Please sign in to comment.