Coder Social home page Coder Social logo

graf's People

Contributors

shua avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

graf's Issues

Doesn't handle dashboard variables

grafana allows you to define dashboard variables and then use them in queries like $foo. When we pull down the dashboard though, it tries to query with $foo instead of the value and gets no data.

-f(ollow) + influx => no data

I've noticed influxdb returns no data for small timespans (eg now-2s to now). This is unhelpful when we have --interval 1 -f because it's only requesting a small enough window of data to plot the next line, but influxdb will never return anything.

One possible way to improve this is to fetch a larger span of time with each refresh. This is what grafana web ui does, and it replots everything with every refresh (I guess unless it's a streaming data source, see #4). However, I don't want to fill up the terminal history with copies of the same plotted data, so if graf replots, it should move the cursor up to the line that corresponds with whatever the first time value is in the current data.

example

Let's say we've already plotted from 07:20-07:23 using 30 lines in the terminal. This would put the line corresponding to 07:21 at line 10 from the start, while the cursor is at line 30. If we wait 1 minute, and fetch data for 07:21-07:24, then in order to plot that data we should move the cursor up 20 lines (30 - 20 = 10). So we need to send \e[20A to the terminal and then plot the data.

Not clear yet what happens when we try to move up 20 lines but the screen only has eg 10 rows.

alternative - clear screen

One alternative is to ditch the line-by-line updates and instead limit the plotting to only be as big as the current terminal size, and clear the screen with each refresh. I kind of like the scrolling plot though, so I want to keep it for now, but maybe there can be another mode that jumps into terminal alt-screen to plot without filling up the terminal scroll history.

alternative - it's the user's fault

If you try to query from: now-2s to: now in grafana, it will just print no data, and it's expected that the user figures out their error and requests a larger timespan. Similarly, we could just expect the user to set --interval to a high enough value that influxdb returns data.

references

ANSI escapes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.