logo
down
shadow

Make InfluxDB/Grafana cumulative function that resets daily (sawtooth graph)


Make InfluxDB/Grafana cumulative function that resets daily (sawtooth graph)

By : Henk
Date : October 21 2020, 08:10 PM
Hope this helps I found a solution, it's quite simple in the end:
code :
SELECT kaifa-kaifa_fill as Energy FROM
  (SELECT first(kaifa) as kaifa_fill from energyv2 WHERE $timeFilter group by time(1d) TZ('Europe/Amsterdam')),
  (SELECT first(kaifa) as kaifa from energyv2 WHERE $timeFilter GROUP BY time($__interval))
fill(previous)
time                 kaifa     kaifa_fill kaifa_kaifa_fill
----                 -----     ---------- ----------------
2019-08-03T00:00:00Z 179688195 179688195  0
2019-08-03T01:00:00Z 179746833 179688195  58638
2019-08-03T02:00:00Z 179803148 179688195  114953
2019-08-03T03:00:00Z 179859464 179688195  171269
2019-08-03T04:00:00Z 179914038 179688195  225843
2019-08-03T05:00:00Z 179967450 179688195  279255
2019-08-03T06:00:00Z 179905910 179688195  217715
2019-08-03T07:00:00Z 179847272 179688195  159077
2019-08-03T08:00:00Z 179698065 179688195  9870
2019-08-03T09:00:00Z 179378170 179688195  -310025
2019-08-03T10:00:00Z 179341013 179688195  -347182
2019-08-03T11:00:00Z 179126201 179688195  -561994
2019-08-03T12:00:00Z 179039116 179688195  -649079
2019-08-03T13:00:00Z 178935193 179688195  -753002
2019-08-03T14:00:00Z 178687870 179688195  -1000326
2019-08-03T15:00:00Z 178517762 179688195  -1170433
2019-08-03T16:00:00Z 178409776 179688195  -1278420
2019-08-03T17:00:00Z 178376102 179688195  -1312093
2019-08-03T18:00:00Z 178388875 179688195  -1299320
2019-08-03T19:00:00Z 178780181 179688195  -908015
2019-08-03T20:00:00Z 178928226 179688195  -759969
2019-08-03T21:00:00Z 179065241 179688195  -622954
2019-08-03T22:00:00Z 179183098 179688195  -505098
2019-08-03T23:00:00Z 179306179 179688195  -382016
2019-08-04T00:00:00Z 179306179 179370042  -63863
2019-08-04T00:00:00Z 179370042 179370042  0
2019-08-04T01:00:00Z 179417649 179370042  47607
2019-08-04T02:00:00Z 179464094 179370042  94053
2019-08-04T03:00:00Z 179509960 179370042  139918
2019-08-04T04:00:00Z 179591820 179370042  221779
2019-08-04T05:00:00Z 179872817 179370042  502775
2019-08-04T06:00:00Z 180056278 179370042  686236
2019-08-04T07:00:00Z 179929713 179370042  559671
2019-08-04T08:00:00Z 179514604 179370042  144562
2019-08-04T09:00:00Z 179053049 179370042  -316992
2019-08-04T10:00:00Z 178683225 179370042  -686817
2019-08-04T11:00:00Z 178078269 179370042  -1291773
2019-08-04T12:00:00Z 177650387 179370042  -1719654
2019-08-04T13:00:00Z 177281724 179370042  -2088317
2019-08-04T14:00:00Z 177041367 179370042  -2328674
2019-08-04T15:00:00Z 176807397 179370042  -2562645
2019-08-04T16:00:00Z 176737148 179370042  -2632894
2019-08-04T17:00:00Z 176677349 179370042  -2692693
2019-08-04T18:00:00Z 176690702 179370042  -2679340
2019-08-04T19:00:00Z 176734825 179370042  -2635216
2019-08-04T20:00:00Z 176810300 179370042  -2559742
2019-08-04T21:00:00Z 176866035 179370042  -2504007
2019-08-04T22:00:00Z 176914803 179370042  -2455239
2019-08-04T23:00:00Z 176965893 179370042  -2404149
2019-08-05T00:00:00Z 176965893 177016983  -51090
2019-08-05T00:00:00Z 177016983 177016983  0


Share : facebook icon twitter icon
grafana scripted influxdb

grafana scripted influxdb


By : user6561237
Date : March 29 2020, 07:55 AM
it helps some times Well I found out how it works, but I have to say it is wierd that it is not documented anywhere and it involves a little modification to the source code...
A little bit of context first
code :
> show series
key
---
nagios.CPULoad,hostname=cbba.storage,state=OK
nagios.CPULoad,hostname=ussd1,state=OK
nagios.CPULoad,hostname=ussd2,state=OK
nagios.CPULoad,hostname=ussd3,state=OK
nagios.CPULoad,hostname=ussd4,state=OK
> select * from "nagios.CPULoad" limit 1
name: nagios.CPULoad
time                hostname     load1 load15 load5 state
----                --------     ----- ------ ----- -----
1487867813000000000 cbba.storage 0     0      0     OK
http://10.72.6.220:3000/dashboard/script/scripted.js?name=CPULoad&field=load1&hostname=ussd3
name indicates the series in influxDB I want to graph
field indicates which field to use
hostname indicates the host to choose
SELECT mean("load1") FROM "nagios.CPULoad" WHERE "hostname" = 'ussd3' AND $timeFilter GROUP BY time($interval) fill(null)
    targets: [
      {
        "measurement": "nagios." + ARGS.name,
        "metric": ARGS.name,
        "tags": {
            "hostname": {
                  operator: "=" ,
                  value: ARGS.hostname
                }
        },
        "select": [[{
                    type: "field",
                    params: [ARGS.field]
                }, {
                    type: "mean",
                    params: []
                }]],
      },
    ],
a.prototype.renderTagCondition = function(a, b, c) {
    var d = ""
      , e = a.operator
      , f = a.value;
    return b > 0 && (d = (a.condition || "AND") + " "),
    e || (e = /^\/.*\/$/.test(f) ? "=~" : "="),
    "=~" !== e && "!~" !== e ? (c && (f = this.templateSrv.replace(f, this.scopedVars)),
    ">" !== e && "<" !== e && (f = "'" + f.replace(/\\/g, "\\\\") + "'")) : c && (f = this.templateSrv.replace(f, this.scopedVars, "regex")),
    d + '"' + a.key + '" ' + e + " " + f
}
d + '"' + a.key + '" ' + e + " " + f
d + '"' + b + '" ' + e + " " + f
How can I make a cumulative sum graph in grafana, from an elasticsearch data source?

How can I make a cumulative sum graph in grafana, from an elasticsearch data source?


By : user3021325
Date : March 29 2020, 07:55 AM
I hope this helps you . After contacting grafana directly I received the answer that this is not currently possible. All such computation must be done by the data source, not by grafana.
How can i generate a "connect time over time" graph in grafana with jmeter+influxDB+Grafana Stack?

How can i generate a "connect time over time" graph in grafana with jmeter+influxDB+Grafana Stack?


By : user3440303
Date : March 29 2020, 07:55 AM
I wish did fix the issue. As per Metrics Exposed chapter of the Real-time results Connect Time is not something which is available as per JMeter 5.2.1
You can come up with a custom implementation of the AbstractBackendListenerClient which will collect and send Connect Times.
code :
prev.setSentBytes(prev.getConnectTime())
JS based influxdb graph editors like Grafana, Influga, are there reusable libraries?

JS based influxdb graph editors like Grafana, Influga, are there reusable libraries?


By : wbhilton
Date : March 29 2020, 07:55 AM
hope this fix your issue Grafana v2.0 allows you to use Embed Panel with "iframe" tag.
It's very usefull when you trying to integrate graph in another system.
influxdb sum first value metric of different series but same time interval for grafana graph

influxdb sum first value metric of different series but same time interval for grafana graph


By : Coby Forrester
Date : March 29 2020, 07:55 AM
should help you out I think this is not possible at moment (with InfluxDB 0.9). In order to compute ratios between timeseries (fields) you would have to be able to do either nested queries or joins which were deprecated in InfluxDB 0.9:
Related Posts Related Posts :
  • Replaying merged streams individually
  • DevExpress GridColumn strange proportional sizing
  • Drools Decision table error : Error while creating KieBase
  • Kafka-Flink-Stream processing: Is there a way to reload input files into the variables being used in a streaming process
  • How to export and import nifi flow from one HDP to another HDP
  • map pointWidth to a single Datapoint in Column Chart
  • Pygame animating image by transforming it
  • Why is my Gdk/cairo class causing a segfault?
  • How to organize queues in Masstransit/RabbitMQ?
  • How to remove a collection element without EntityManager#remove(...) in Doctrine 2?
  • how to change the format of the return value of 'mnist.load_data()' to 'mnist_train.csv' in Keras?
  • CodeFights Interview Practice- Dynamic Programing : Basic : fillingBlocks
  • Accessing the built request details in Karate
  • How to draw a polyline with initial point in Leaflet
  • docusign transform pdf field with text tab as required
  • How to avoid "unused variable in a for loop" error
  • Clipping a polygon to only draw within a circle in Love2D
  • Can't import library in Python
  • Silverstripe - Turn modules on or off in config
  • How does shared memory work behind the scene in Linux?
  • Vue - how to bind table column to a data object?
  • OrientDB deep traversal until specific class
  • Static code analysis of Dockerfiles?
  • Is Batmobile Defy Mini a fake device?
  • Reverse a list to a range
  • Add multiple y-axis to SAPUI5 VizFrame Column Charts
  • Nightmare with rabbitmq.client versions
  • How to change timeout for a request in okhttp
  • How to support relative date parameters in Web Intelligence Report
  • cfEngine3 - class if package is installed
  • Count number of sentences in a string in SAS
  • Visit Last Loaded URL
  • What are the use cases to substitute cookbook array attribute in chef?
  • Forgerock - emb.creatingfamsuffix.failure Error when creating the Default Configuration
  • Entity Framework Core 2 : Easily update an object and it's relations
  • Digitize a filled contour plot
  • Service Fabric "Waiting for upgrade..." using VSTS
  • How to convert an IndexedTable to a DataFrame in Julia?
  • Mvc5 pass model to Layout Page
  • How to set queues manager configuration to 'optional'?
  • What guarantees does zlib's inflate/deflate make about avail_in and avail_out?
  • MariaDB - embed function to automatically sum columns and store result?
  • Laravel share Auth::User() info
  • Enable keys in Azure AD application
  • Stripe Payment API with Customer and Card ID
  • iText 7 relative column width no longer working starting iText 7.0.2
  • Customer Master - Contact Person details
  • How to express inheritance in Coq?
  • Sending direct message to a bot in slack and get the response
  • Yii2 dropDownList Default value
  • MSMQ. Who can create a local queue (permissions required)?
  • how to pass angular 2 $scope variables into the Node.js server
  • root undoing previous changes after sudo su user
  • Create X509 Certificate from.p12 or .pem certificate
  • Keras layer.set_weights doesn't modify the layer. Why?
  • Available build tasks in TFS 2017
  • Change oracle apex database user
  • How to parse typesafe config with objects
  • Is "Comment" a protected word in the Open API 3.0 spec or Swagger Editor?
  • Display Percentage in a Row in Tableau
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org