Change returns the total amount of change in y values over the period
Change returns the total amount of change in y values over the period

This is useful for rate queries, and you want to know the total change in position.

Since opentsdb may return a different time period than requested, this function extrapolates the value to fit the requested time period.

Don't need y, len check doesn't make sense, and fix a couple logical errors

Don't need i; style

Remove extra (); remove leftover min/max lines

Correct return type for the function

Much simpler function than originally thought

snowsnail/bosun,Skyscanner/bosun,vitorboschi/bosun,youngl98/bosun,objStorage/bosun,dbirchak/bosun,briantist/bosun,mhenderson-so/bosun,mxk1235/bosun,GROpenSourceDev/bosun,dimamedvedev/bosun,dimamedvedev/bosun,evgeny-potapov/bosun,jareksm/bosun,shanemadden/bosun,mhenderson-so/bosun,azhurbilo/bosun,TrentScholl/bosun,briantist/bosun,eMerzh/bosun,bookingcom/bosun,bridgewell/bosun,mehulkar/bosun,yyljlyy/bosun,mnikhil-git/bosun,seekingalpha/bosun,treejames/bosun,couchand/bosun,trigrass2/bosun,shanemadden/bosun,shanemadden/bosun,snowsnail/bosun,Dieterbe/bosun,mhenderson-so/bosun,couchand/bosun,gregdel/bosun,noblehng/bosun,cazacugmihai/bosun,jareksm/bosun,leapar/bosun,gregdel/bosun,influxdata/bosun,cyngn/bosun,CheRuisiBesares/bosun,CheRuisiBesares/bosun,bridgewell/bosun,yyljlyy/bosun,inkel/bosun,gregdel/bosun,bookingcom/bosun,evgeny-potapov/bosun,CheRuisiBesares/bosun,TrentScholl/bosun,bosun-monitor/bosun,CheRuisiBesares/bosun,alienth/bosun,simnv/bosun,alienth/bosun,seekingalpha/bosun,vimeo/bosun,briantist/bosun,gregdel/bosun,eMerzh/bosun,dieface/bosun,leapar/bosun,snowsnail/bosun,couchand/bosun,noblehng/bosun,mhenderson-so/bosun,mnikhil-git/bosun,dieface/bosun,couchand/bosun,evgeny-potapov/bosun,influxdb/bosun,TrentScholl/bosun,bosun-monitor/bosun,csmith-palantir/bosun,fisdap/bosun,cazacugmihai/bosun,dimamedvedev/bosun,mnikhil-git/bosun,influxdb/bosun,shanemadden/bosun,bridgewell/bosun,GROpenSourceDev/bosun,csmith-palantir/bosun,leapar/bosun,TrentScholl/bosun,dimamedvedev/bosun,noblehng/bosun,bosun-monitor/bosun,mnikhil-git/bosun,fisdap/bosun,simnv/bosun,cyngn/bosun,jareksm/bosun,mhenderson-so/bosun,dieface/bosun,inkel/bosun,simnv/bosun,alienth/bosun,gregdel/bosun,yyljlyy/bosun,dieface/bosun,dbirchak/bosun,bosun-sharklasers/bosun,objStorage/bosun,cyngn/bosun,madhukarreddy/bosun,treejames/bosun,azhurbilo/bosun,fisdap/bosun,cazacugmihai/bosun,bosun-sharklasers/bosun,leapar/bosun,madhukarreddy/bosun,inkel/bosun,noblehng/bosun,yyljlyy/bosun,augporto/bosun,melifaro/bosun,Skyscanner/bosun,objStorage/bosun,vitorboschi/bosun,TrentScholl/bosun,influxdata/bosun,Dieterbe/bosun,jareksm/bosun,dbirchak/bosun,SlashmanX/bosun,dieface/bosun,madhukarreddy/bosun,dimamedvedev/bosun,shanemadden/bosun,SlashmanX/bosun,vimeo/bosun,SlashmanX/bosun,mathpl/bosun,augporto/bosun,dbirchak/bosun,jareksm/bosun,azhurbilo/bosun,madhukarreddy/bosun,leapar/bosun,treejames/bosun,mathpl/bosun,gregdel/bosun,alienth/bosun,mathpl/bosun,youngl98/bosun,youngl98/bosun,simnv/bosun,fisdap/bosun,seekingalpha/bosun,bookingcom/bosun,snowsnail/bosun,dbirchak/bosun,influxdata/bosun,briantist/bosun,inkel/bosun,Skyscanner/bosun,Skyscanner/bosun,briantist/bosun,fisdap/bosun,youngl98/bosun,vitorboschi/bosun,objStorage/bosun,mathpl/bosun,madhukarreddy/bosun,bosun-sharklasers/bosun,vimeo/bosun,melifaro/bosun,mnikhil-git/bosun,Skyscanner/bosun,GROpenSourceDev/bosun,evgeny-potapov/bosun,influxdb/bosun,vitorboschi/bosun,bosun-sharklasers/bosun,snowsnail/bosun,azhurbilo/bosun,eMerzh/bosun,bosun-sharklasers/bosun,mhenderson-so/bosun,SlashmanX/bosun,couchand/bosun,jareksm/bosun,csmith-palantir/bosun,azhurbilo/bosun,Dieterbe/bosun,noblehng/bosun,cazacugmihai/bosun,trigrass2/bosun,bosun-monitor/bosun,CheRuisiBesares/bosun,youngl98/bosun,eMerzh/bosun,bridgewell/bosun,trigrass2/bosun,csmith-palantir/bosun,augporto/bosun,fisdap/bosun,bridgewell/bosun,noblehng/bosun,snowsnail/bosun,mehulkar/bosun,simnv/bosun,bookingcom/bosun,alienth/bosun,leapar/bosun,cyngn/bosun,GROpenSourceDev/bosun,Dieterbe/bosun,bridgewell/bosun,cazacugmihai/bosun,bosun-sharklasers/bosun,GROpenSourceDev/bosun,Skyscanner/bosun,eMerzh/bosun,yyljlyy/bosun,seekingalpha/bosun,seekingalpha/bosun,mathpl/bosun,mxk1235/bosun,trigrass2/bosun,yyljlyy/bosun,melifaro/bosun,mnikhil-git/bosun,TrentScholl/bosun,alienth/bosun,objStorage/bosun,trigrass2/bosun,augporto/bosun,eMerzh/bosun,mehulkar/bosun,vitorboschi/bosun,mxk1235/bosun,couchand/bosun,cyngn/bosun,influxdb/bosun,evgeny-potapov/bosun,mehulkar/bosun,mehulkar/bosun,melifaro/bosun,briantist/bosun,influxdata/bosun,influxdb/bosun,mxk1235/bosun,bosun-monitor/bosun,melifaro/bosun,dieface/bosun,shanemadden/bosun,bookingcom/bosun,mathpl/bosun,treejames/bosun,seekingalpha/bosun,treejames/bosun,mxk1235/bosun,madhukarreddy/bosun,GROpenSourceDev/bosun,inkel/bosun,SlashmanX/bosun,SlashmanX/bosun,mxk1235/bosun,vitorboschi/bosun,augporto/bosun,csmith-palantir/bosun,treejames/bosun,cazacugmihai/bosun,dimamedvedev/bosun,influxdata/bosun,csmith-palantir/bosun,bookingcom/bosun,cyngn/bosun,trigrass2/bosun,vimeo/bosun,inkel/bosun,augporto/bosun,evgeny-potapov/bosun,influxdata/bosun,simnv/bosun,CheRuisiBesares/bosun,youngl98/bosun,dbirchak/bosun,bosun-monitor/bosun,melifaro/bosun,objStorage/bosun,mehulkar/bosun,azhurbilo/bosun,influxdb/bosun