MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / hdr_add

Function hdr_add

deps/hdr_histogram/hdr_histogram.c:568–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568int64_t hdr_add(struct hdr_histogram* h, const struct hdr_histogram* from)
569{
570 struct hdr_iter iter;
571 int64_t dropped = 0;
572 hdr_iter_recorded_init(&iter, from);
573
574 while (hdr_iter_next(&iter))
575 {
576 int64_t value = iter.value;
577 int64_t count = iter.count;
578
579 if (!hdr_record_values(h, value, count))
580 {
581 dropped += count;
582 }
583 }
584
585 return dropped;
586}
587
588int64_t hdr_add_while_correcting_for_coordinated_omission(
589 struct hdr_histogram* h, struct hdr_histogram* from, int64_t expected_interval)

Callers

nothing calls this directly

Calls 3

hdr_iter_recorded_initFunction · 0.85
hdr_iter_nextFunction · 0.85
hdr_record_valuesFunction · 0.85

Tested by

no test coverage detected