From b4cd48a79ca724d8741862ff7e4fb9ba3531bc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 9 Dec 2013 20:01:25 +0100 Subject: [PATCH] added support for maxDataPoints --- grafana.sublime-project | 18 + grafana.sublime-workspace | 531 +++++++++++++++++++++++++ src/app/panels/graphite/editor.html | 2 +- src/app/panels/graphite/graphiteSrv.js | 6 +- src/app/panels/graphite/module.html | 2 + src/app/panels/graphite/module.js | 3 +- 6 files changed, 557 insertions(+), 5 deletions(-) create mode 100644 grafana.sublime-project create mode 100644 grafana.sublime-workspace diff --git a/grafana.sublime-project b/grafana.sublime-project new file mode 100644 index 00000000000..9a0481f92df --- /dev/null +++ b/grafana.sublime-project @@ -0,0 +1,18 @@ +{ + "folders": + [ + { + "follow_symlinks": true, + "path": ".", + "folder_exclude_patterns": [ + "node_modules" + ] + } + ], + "settings": + { + "tab_size": 2, + "translate_tabs_to_spaces": true, + "trim_trailing_white_space_on_save": true + } +} diff --git a/grafana.sublime-workspace b/grafana.sublime-workspace new file mode 100644 index 00000000000..94a2feb275a --- /dev/null +++ b/grafana.sublime-workspace @@ -0,0 +1,531 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "gra", + "graphiteParameters" + ], + [ + "build", + "build_graphite_url" + ], + [ + "cookie", + "cookieUtil" + ], + [ + "re", + "requesition" + ], + [ + "req", + "requesition" + ], + [ + "res", + "requesition" + ], + [ + "serve", + "serverStatus" + ], + [ + "fet", + "fetchServerStatus" + ], + [ + "conn", + "connectToMongoDb" + ], + [ + "mongo", + "mongoDbUrl" + ], + [ + "fetc", + "fetchDataForInstance" + ] + ] + }, + "buffers": + [ + { + "file": "src/config.dev.js", + "settings": + { + "buffer_size": 1509, + "line_ending": "Windows" + } + }, + { + "file": "src/app/panels/graphite/graphiteSrv.js", + "settings": + { + "buffer_size": 3330, + "line_ending": "Windows" + } + }, + { + "contents": "Searching 14481 files for \"maxDataPoints\"\n\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js\nUnable to open /D/oss/grafana/node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js\n\n\nSearching 636 files for \"maxDataPoints\"\n\n0 matches across 0 files\n", + "settings": + { + "buffer_size": 9412, + "line_ending": "Windows", + "name": "Find Results", + "scratch": true + } + } + ], + "build_system": "", + "command_palette": + { + "height": 210.0, + "selected_items": + [ + [ + "syn ava", + "Set Syntax: JavaScript" + ], + [ + "Install ", + "Package Control: Install Package" + ], + [ + "powers", + "SublimeREPL: PowerShell" + ], + [ + "install ", + "Package Control: Install Package" + ], + [ + "install", + "Package Control: Install Package" + ], + [ + "Install", + "Package Control: Install Package" + ], + [ + "remove ", + "Package Control: Remove Package" + ], + [ + "Package Control: ", + "Package Control: List Packages" + ], + [ + "insta", + "Package Control: Install Package" + ], + [ + "packa", + "Package Control: Install Package" + ], + [ + "packa ", + "Package Control: Install Package" + ], + [ + "Pack", + "Package Control: Remove Package" + ] + ], + "width": 386.0 + }, + "console": + { + "height": 368.0, + "history": + [ + "import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())" + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "file_history": + [ + "/D/Temp/graphite-web-0.9.12/graphite-web-0.9.12/webapp/graphite/views.py", + "/D/Temp/graphite-web-0.9.12/graphite-web-0.9.12/webapp/graphite/render/views.py", + "/D/ebay/tradera/DB/Main/5_sprocs/Listing/EbaySweden_Trading_Listing_GetItemForRestart.proc.sql", + "//dashboards/d$/Inetpub/GiraffeOps/dashboards.js", + "/D/oss/grafana/src/app/partials/inspector.html", + "/D/ebay/tradera/Applications/TouchWeb/src/EbaySweden.TouchWeb/static/script/app/ui/layout/google-tagmanager.js", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.json", + "/D/ebay/tradera/Applications/TouchWeb/src/EbaySweden.TouchWeb/static/script/utils/cookie.js", + "/D/ebay/tradera/Applications/TouchWeb/src/EbaySweden.TouchWeb/static/script/app/boot/boot-layout.js", + "/D/ebay/tradera/Applications/TouchWeb/build/js-and-css.ps1", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.prod_tradera_site.json", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.prod_app_servers.json", + "/D/ebay/tradera/Applications/TouchWeb/node_modules/grunt-contrib-uglify/package.json", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.test.json", + "/D/oss/mongodb-metrics/node_modules/mongodb/lib/mongodb/admin.js", + "/D/oss/mongodb-metrics/node_modules/mongodb/lib/mongodb/connection/repl_set/repl_set.js", + "/D/oss/mongodb-metrics/node_modules/mongodb/lib/mongodb/connection/repl_set/options.js", + "/D/oss/mongodb-metrics/node_modules/mongodb/lib/mongodb/db.js", + "/D/oss/mongodb-metrics/node_modules/mongodb/lib/mongodb/commands/db_command.js", + "/D/ebay/tradera/Deployment/VerificationPackages/TraderaSite/run.js", + "/C/Users/todegaard/AppData/Roaming/Sublime Text 3/Packages/User/node_app_js.sublime-build", + "/D/ebay/tools/Tools/AppLogs2Elastic/Gruntfile.js", + "/D/oss/mongodb-metrics/gruntfile.js", + "/C/Users/todegaard/AppData/Roaming/Sublime Text 3/Packages/User/Preferences.sublime-settings", + "/D/oss/asimov-deploy-ui/Gruntfile.js", + "/D/ebay/tradera/Applications/TouchWeb/Gruntfile.js", + "/D/oss/mongodb-metrics/app.js", + "/D/oss/mongodb-metrics/tests/test.js", + "/C/Users/todegaard/AppData/Roaming/Sublime Text 3/Installed Packages/Tomorrow Color Schemes.sublime-package", + "/D/ebay/tradera/Build/EbaySweden-StartBuild.ps1", + "/D/ebay/tradera/Applications/TouchWeb/src/EbaySweden.TouchWeb/static/script/app.js", + "/D/ebay/tradera/Applications/TouchWeb/src/EbaySweden.TouchWeb/static/script/app/ui/view-item/bidding-ui.js", + "/D/ebay/tools/Tools/AppLogs2Elastic/App.config", + "//dashboards/d$/Inetpub/Kibana/config.js", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.prod_api.json", + "/D/ebay/asimov-tradera/WinAgent.ConfigFiles/config.prod_tradera_site_test.json", + "/C/Users/todegaard/AppData/Roaming/Sublime Text 3/Packages/User/Package Control.sublime-settings" + ], + "find": + { + "height": 41.0 + }, + "find_in_files": + { + "height": 104.0, + "where_history": + [ + "D:\\Temp\\graphite-web-0.9.12\\graphite-web-0.9.12", + "", + " \"filter\": {\n \"list\": {\n \"0\": {\n \"type\": \"time\",\n \"field\": \"@timestamp\",\n \"from\": \"now-1h\",\n \"to\": \"now\",\n \"mandate\": \"must\",\n \"active\": true,\n \"alias\": \"\",\n \"id\": 0\n }\n },\n \"ids\": [\n 0\n ]\n", + " \"filter\": {\n \"list\": {\n \"0\": {\n \"type\": \"time\",\n \"field\": \"@timestamp\",\n \"from\": \"now-1h\",\n \"to\": \"now\",\n \"mandate\": \"must\",\n \"active\": true,\n \"alias\": \"\",\n \"id\": 0\n }\n },\n \"ids\": [\n 0\n ]\n ", + "D:\\oss\\mongodb-metrics\\node_modules\\mongodb", + "D:\\ebay\\tradera\\Applications\\TouchWeb", + "D:\\ebay\\tradera" + ] + }, + "find_state": + { + "case_sensitive": false, + "find_history": + [ + "graphite_options", + "maxDataPoints", + "kibanaSimplePanel", + "kibanaPanel", + "
- +
diff --git a/src/app/panels/graphite/graphiteSrv.js b/src/app/panels/graphite/graphiteSrv.js index de0fd8e0196..0c2731510f7 100644 --- a/src/app/panels/graphite/graphiteSrv.js +++ b/src/app/panels/graphite/graphiteSrv.js @@ -11,7 +11,7 @@ function ($, RQ, config) { raw = raw || false; var clean_options = []; //var internal_options = ['_t']; - var graphite_options = ['target', 'targets', 'from', 'until', 'rawData', 'format']; + var graphite_options = ['target', 'targets', 'from', 'until', 'rawData', 'format', 'maxDataPoints']; var graphite_png_options = ['areaMode', 'width', 'height', 'template', 'margin', 'bgcolor', 'fgcolor', 'fontName', 'fontSize', 'fontBold', 'fontItalic', 'yMin', 'yMax', 'colorList', 'title', 'vtitle', 'lineMode', @@ -55,7 +55,6 @@ function ($, RQ, config) { clean_options.push(key + "=" + encodeURIComponent(value)); } }); - return clean_options; } @@ -65,7 +64,8 @@ function ($, RQ, config) { var graphOptions = { from: $.plot.formatDate(options.range.from, '%H%:%M_%Y%m%d'), until: $.plot.formatDate(options.range.to, '%H%:%M_%Y%m%d'), - targets: options.targets + targets: options.targets, + maxDataPoints: options.maxDataPoints } var graphiteParameters = build_graphite_options(graphOptions, true); diff --git a/src/app/panels/graphite/module.html b/src/app/panels/graphite/module.html index 4ed4d668d6f..efa17d68b24 100644 --- a/src/app/panels/graphite/module.html +++ b/src/app/panels/graphite/module.html @@ -103,7 +103,9 @@
+
+ diff --git a/src/app/panels/graphite/module.js b/src/app/panels/graphite/module.js index a1ad43c2bb3..2b7134bf52e 100644 --- a/src/app/panels/graphite/module.js +++ b/src/app/panels/graphite/module.js @@ -298,7 +298,8 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) { var graphiteLoadOptions = { range: range, - targets: $scope.panel.targets + targets: $scope.panel.targets, + maxDataPoints: $scope.panel.span * 100 }; var result = RQ.sequence([