Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

API v3 / v2 returns fractional values for absolute dimensions — how to get raw integer samples?#21171

Unanswered
pingulee asked this question inQ&A
Discussion options

Summary

I’m developing a custompython.d plugin that collectsinteger counter values every second

However, when I query the data via Netdata’s API (/api/v2/data or/api/v3/data),
I sometimes see fractional values such as:

[1760926238,    [689,0,0,1]],[1760926237,    [687,0,0,1]],[1760926236,    [686.0026,0,0,1]],[1760926235,    [686,0,0,1]],[1760926234,    [685,0,0,1]],[1760926233,    [684,0,0,1]],[1760926232,    [683,0,0,1]],[1760926231,    [681,0,0,1]],[1760926230,    [680.002,0,0,1]],[1760926229,    [680,0,0,1]],[1760926228,    [679,0,0,1]],
frombases.FrameworkServices.SimpleServiceimportSimpleServiceupdate_every=1priority=2ORDER= ['test']CHARTS= {'test': {'options': [None,'Bandwidth','bytes/s','traffic','test.test','line'],'lines': [            ['test','test','absolute']        ]    }}classService(SimpleService):def__init__(self,configuration=None,name=None):SimpleService.__init__(self,configuration=configuration,name=name)self.counter=0defcheck(self):returnTruedef_get_data(self):self.counter+=1data= {'test':int(self.counter)        }returndata

Expected Behavior

For absolute dimensions, I would like the API to return exact raw integer samples
as stored in the DB (tier 0), without any fractional interpolation or partial-bucket adjustment.

Actual Behavior

Occasionally small fractional offsets appear in the API results,
even when querying with:

http://127.0.0.1:19999/api/v3/data?contexts=test&options=raw,seconds,natural-points,unaligned,selected-tier&tier=0&time_group=sum
options=raw,seconds,natural-points,unaligned,selected-tier
tier=0
time_group=sum

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@pingulee

[8]ページ先頭

©2009-2025 Movatter.jp