GithubHelp home page GithubHelp logo

Support for static images about graph-explorer HOT 4 CLOSED

vimeo avatar vimeo commented on May 29, 2024
Support for static images

from graph-explorer.

Comments (4)

Dieterbe avatar Dieterbe commented on May 29, 2024

how do you get these numbers? and what does svg mean? (graphite has no svg format? http://graphite.readthedocs.org/en/1.0/url-api.html) assuming it's mostly network transfer times, we could look into compression of data, a less verbose graphite format (i.e. raw instead of json), serverside aggregation or even client-side caching of metrics

since i will be adding more interactive features, i focus on client side rendering using flot (which uses canvas; i found it quite fast, esp. much faster than svg based solutions like d3/rickshaw).
but as you can see i abstracted the rendering of the graphs through a little plugin called graphitejs: https://github.com/Dieterbe/graphitejs
it supports png's, rickshaw and flot through an almost identical api, so switching to PNG's should be trivial.
you'll also notice the graphitejs source code is simple to get into, i'm certainly open for pull requests that make it more efficient.

from graph-explorer.

rtoma avatar rtoma commented on May 29, 2024

Thanks for your answer. I will look into the abstraction layer and will try to contribute.

Regarding your questions:

The 1.0 url-api page seems incomplete. If you look at http://graphite.readthedocs.org/en/latest/render_api.html#data-display-formats you will find the following formats mentioned:

&format=png
&format=raw
&format=csv
&format=json
&format=svg

Note that I don't really care about svg. I simply used it as a 3rd format the test (besides json and png).

For performancetesting I used this iterator:

for n in 1 2 3 ; do
  for h in `seq 2 4 50`; do
    for o in svg png json; do
      ./query.sh $o $h
    done
  done
done

And "query.sh" is:

#!/bin/sh

format=$1
[ -z "$format" ] && format=json
from=$2
[ -z "$from" ] && from=24

output=$format-$from.out

echo -n "format=$format from=$from "

curl -w 'rc=%{http_code} time_total=%{time_total} time_starttransfer=%{time_starttransfer} size_download=%{size_download} speed_download=%{speed_download}\n' -s -o $output "<large-graphite-test-url-using-$from-and-$output>"

Running the for-loops result in output like:

format=svg from=2 rc=200 time_total=1.460 time_starttransfer=1.062 size_download=553878 speed_download=379292.000
format=png from=2 rc=200 time_total=1.322 time_starttransfer=1.144 size_download=145056 speed_download=109685.000
format=json from=2 rc=200 time_total=1.519 time_starttransfer=0.969 size_download=600604 speed_download=395282.000
format=svg from=6 rc=200 time_total=2.180 time_starttransfer=1.658 size_download=764447 speed_download=350673.000
format=png from=6 rc=200 time_total=1.003 time_starttransfer=0.880 size_download=108287 speed_download=107972.000
format=json from=6 rc=200 time_total=3.513 time_starttransfer=2.297 size_download=1781514 speed_download=507105.000
...

Which I copied to Excel to do a pivot and make the graph.

Below you'll find a graph using time_starttransfer ("first byte time") instead of time_total, thus ignoring the download size + speed.

firstbyte

The time Graphite needs before sending the 1st byte is most likely related to the size of the result it is preparing. Graph below shows you the download_size.

sizedownload

If you have any questions, please let me know!

from graph-explorer.

Dieterbe avatar Dieterbe commented on May 29, 2024

https://github.com/Dieterbe/graphitejs/issues/1 here, I made this ticket in case someone wants to make graphitejs faster.
looking at your graphs, it seems the slowdown is mostly caused by the extra time graphite needs to generate the output, and not to actually transfer the data. that's interesting. have you checked mem/cpu load of your graphite machine when you do the json requests?

from graph-explorer.

rtoma avatar rtoma commented on May 29, 2024

Graphite machine was at 100% CPU during the handling of the requests. As I mentioned, the hardware is below par.

When requesting data for 50 hours for 42 metrics, each having 1 point per 10 seconds, results in 50 * 3600 * 42 * 10/60 = 1.26M datapoints. A PNG will not really get bigger when requesting more metrics or more history, but JSON/RAW/CSV will. Maybe add a summarize function to downsample the data and get as much datapoints as the final graph has resolution on the X-axis? That way clientside rendering scales no matter the number of metrics or history selected. Just a thought.

from graph-explorer.

Related Issues (20)

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.