You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by ho...@apache.org on 2016/03/16 19:32:06 UTC
incubator-quarks git commit: QUARKS33 fixed x-axis legend when many
oplets have metrics
Repository: incubator-quarks
Updated Branches:
refs/heads/master 58be021ac -> 9220108b4
QUARKS33 fixed x-axis legend when many oplets have metrics
Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks/commit/9220108b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks/tree/9220108b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks/diff/9220108b
Branch: refs/heads/master
Commit: 9220108b4e25e890ab738cca509625084eae41f8
Parents: 58be021
Author: Susan L. Cline <ho...@apache.org>
Authored: Wed Mar 16 11:07:16 2016 -0700
Committer: Susan L. Cline <ho...@apache.org>
Committed: Wed Mar 16 11:08:04 2016 -0700
----------------------------------------------------------------------
console/servlets/webapp_content/js/index.js | 2 +-
console/servlets/webapp_content/js/metrics.js | 18 +++++++-----------
.../samples/console/ConsoleWaterDetector.java | 9 +++++++++
3 files changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/9220108b/console/servlets/webapp_content/js/index.js
----------------------------------------------------------------------
diff --git a/console/servlets/webapp_content/js/index.js b/console/servlets/webapp_content/js/index.js
index b7b3ef5..482249e 100644
--- a/console/servlets/webapp_content/js/index.js
+++ b/console/servlets/webapp_content/js/index.js
@@ -781,7 +781,7 @@ var fetchMetrics = function() {
var metricSelected = d3.select("#metrics").node().value;
var queryString = "metrics?job=" + selectedJobId + "&metric=" + metricSelected;
if (metricSelected !== "") {
- metricFunction(selectedJobId, metricSelected);
+ metricFunction(selectedJobId, metricSelected, true);
}
};
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/9220108b/console/servlets/webapp_content/js/metrics.js
----------------------------------------------------------------------
diff --git a/console/servlets/webapp_content/js/metrics.js b/console/servlets/webapp_content/js/metrics.js
index 6807bdd..c8ba6bc 100644
--- a/console/servlets/webapp_content/js/metrics.js
+++ b/console/servlets/webapp_content/js/metrics.js
@@ -1,7 +1,6 @@
var margin = {top: 15, right: 20, bottom: 30, left: 40};
var metricCWidth = 860 - margin.left - margin.right;
var metricCWideWidth = 1160 - margin.left - margin.right;
-var useWideWidth = false;
var svgCounterPadding = 40;
var metricCHeight = 380 - margin.top - margin.bottom - svgCounterPadding;
var runLineChart = null;
@@ -183,7 +182,7 @@ getTupleCountBucketsIndex = function(counterMetrics, aValue, bIsDerivedValue, is
};
-metricFunction = function(selectedJobId, metricSelected) {
+metricFunction = function(selectedJobId, metricSelected, bUseWideWidth) {
stopLineChart();
// metric selected, i.e: name:Count,type:counter
var queryString = "metrics?job=" + selectedJobId + "&metric=" + metricSelected;
@@ -191,7 +190,7 @@ metricFunction = function(selectedJobId, metricSelected) {
var metricName = metricSelected.split(",")[0].split(":")[1];
var metricType = metricSelected.split(",")[1].split(":")[1];
- var chartWidth = useWideWidth === true ? metricCWideWidth : metricCWidth;
+ var chartWidth = metricCWideWidth;
// rangeRoundBands specifies the width of each bar
// and the distance between each bar (second arg) and
@@ -206,7 +205,7 @@ metricFunction = function(selectedJobId, metricSelected) {
.scale(x)
.orient("bottom");
- if (useWideWidth) {
+ if (bUseWideWidth) {
xAxis.tickFormat("");
}
@@ -373,9 +372,7 @@ plotMetricChartType = function(jobId, metricSelected) {
var yAxisScale;
var yAxis;
var clipPath;
-
- useWideWidth = false;
-
+
if (runLineChart) {
clearInterval(runLineChart);
}
@@ -544,7 +541,6 @@ plotMetricChartType = function(jobId, metricSelected) {
.transition()
.duration(2500)
.ease("linear");
- // .each("end", getMetric);
}
if (timeInt < refreshT) {
@@ -646,7 +642,7 @@ metricsAvailable = function(queryString, jobId, bIsNewJob) {
metricsSelect.selectAll("*").remove();
var selectWidth = 0;
var rateUnitVal = "";
- useWideWidth = false;
+ var useWideWidth = false;
objectArray.forEach(function(obj) {
var tempWidth;
var value = "name:" + obj.name +",type:" + obj.type;
@@ -722,7 +718,7 @@ metricsAvailable = function(queryString, jobId, bIsNewJob) {
});
var jobId = d3.select("#jobs").node().value;
if ( selectedChart === "barChart") {
- metricFunction(jobId, metricsSelect.node().value);
+ metricFunction(jobId, metricsSelect.node().value, useWideWidth);
// if multiple is true, disable the linechart option
if (multiple === "true") {
lineChartOption.property("disabled", true);
@@ -735,7 +731,7 @@ metricsAvailable = function(queryString, jobId, bIsNewJob) {
stopLineChart();
lineChartOption.property("disabled", true);
d3.select("#mChartType").node().value = "barChart";
- metricFunction(jobId, metricsSelect.node().value);
+ metricFunction(jobId, metricsSelect.node().value, useWideWidth);
} else if (multiple === "false" && bIsNewJob && bIsNewJob === true) {
stopLineChart();
// restart it
http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/9220108b/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java
----------------------------------------------------------------------
diff --git a/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java b/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java
index aca08e1..ff99d01 100644
--- a/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java
+++ b/samples/console/src/main/java/quarks/samples/console/ConsoleWaterDetector.java
@@ -4,6 +4,7 @@
*/
package quarks.samples.console;
+import java.io.PrintWriter;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
@@ -147,6 +148,14 @@ public class ConsoleWaterDetector {
System.out.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());
+ try {
+ PrintWriter writer = new PrintWriter("consoleUrl.txt", "UTF-8");
+ writer.println(dp.getServices().getService(HttpServer.class).getConsoleUrl());
+ writer.close();
+ } catch ( Exception e) {
+ e.printStackTrace();
+ }
+
Topology wellTopology = dp.newTopology("ConsoleWaterDetector");
TStream<JsonObject> well1 = waterDetector(wellTopology, 1);