You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2014/05/29 19:45:15 UTC
[6/8] AMBARI-5928. Create and populate Metrics section of a slider
app. (onechiporenko)
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric3.json
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric3.json b/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric3.json
new file mode 100644
index 0000000..83b4121
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric3.json
@@ -0,0 +1,1856 @@
+{
+ "metrics" : {
+ "dfs" : {
+ "namenode" : {
+ "CreateFileOps" : [
+ [
+ 0.0,
+ 1401359340
+ ],
+ [
+ 0.0,
+ 1401359355
+ ],
+ [
+ 0.0,
+ 1401359370
+ ],
+ [
+ 0.0,
+ 1401359385
+ ],
+ [
+ 0.0,
+ 1401359400
+ ],
+ [
+ 0.0,
+ 1401359415
+ ],
+ [
+ 0.0,
+ 1401359430
+ ],
+ [
+ 0.0,
+ 1401359445
+ ],
+ [
+ 0.0,
+ 1401359460
+ ],
+ [
+ 0.0,
+ 1401359475
+ ],
+ [
+ 0.0,
+ 1401359490
+ ],
+ [
+ 0.0,
+ 1401359505
+ ],
+ [
+ 0.0,
+ 1401359520
+ ],
+ [
+ 0.0,
+ 1401359535
+ ],
+ [
+ 0.0,
+ 1401359550
+ ],
+ [
+ 0.0,
+ 1401359565
+ ],
+ [
+ 0.0,
+ 1401359580
+ ],
+ [
+ 0.0,
+ 1401359595
+ ],
+ [
+ 0.0,
+ 1401359610
+ ],
+ [
+ 0.0,
+ 1401359625
+ ],
+ [
+ 0.0,
+ 1401359640
+ ],
+ [
+ 0.0,
+ 1401359655
+ ],
+ [
+ 0.0,
+ 1401359670
+ ],
+ [
+ 0.0,
+ 1401359685
+ ],
+ [
+ 0.0,
+ 1401359700
+ ],
+ [
+ 0.0,
+ 1401359715
+ ],
+ [
+ 0.0,
+ 1401359730
+ ],
+ [
+ 0.0,
+ 1401359745
+ ],
+ [
+ 0.0,
+ 1401359760
+ ],
+ [
+ 0.0,
+ 1401359775
+ ],
+ [
+ 0.0,
+ 1401359790
+ ],
+ [
+ 0.0,
+ 1401359805
+ ],
+ [
+ 0.0,
+ 1401359820
+ ],
+ [
+ 0.0,
+ 1401359835
+ ],
+ [
+ 0.0,
+ 1401359850
+ ],
+ [
+ 0.0,
+ 1401359865
+ ],
+ [
+ 0.0,
+ 1401359880
+ ],
+ [
+ 0.0,
+ 1401359895
+ ],
+ [
+ 0.0,
+ 1401359910
+ ],
+ [
+ 0.0,
+ 1401359925
+ ],
+ [
+ 0.0,
+ 1401359940
+ ],
+ [
+ 0.0,
+ 1401359955
+ ],
+ [
+ 0.0,
+ 1401359970
+ ],
+ [
+ 0.0,
+ 1401359985
+ ],
+ [
+ 0.0,
+ 1401360000
+ ],
+ [
+ 0.0,
+ 1401360015
+ ],
+ [
+ 0.0,
+ 1401360030
+ ],
+ [
+ 0.0,
+ 1401360045
+ ],
+ [
+ 0.0,
+ 1401360060
+ ],
+ [
+ 0.0,
+ 1401360075
+ ],
+ [
+ 0.0,
+ 1401360090
+ ],
+ [
+ 0.0,
+ 1401360105
+ ],
+ [
+ 0.0,
+ 1401360120
+ ],
+ [
+ 0.0,
+ 1401360135
+ ],
+ [
+ 0.0,
+ 1401360150
+ ],
+ [
+ 0.0,
+ 1401360165
+ ],
+ [
+ 0.0,
+ 1401360180
+ ],
+ [
+ 0.0,
+ 1401360195
+ ],
+ [
+ 0.0,
+ 1401360210
+ ],
+ [
+ 0.0,
+ 1401360225
+ ],
+ [
+ 0.0,
+ 1401360240
+ ],
+ [
+ 0.0,
+ 1401360255
+ ],
+ [
+ 0.0,
+ 1401360270
+ ],
+ [
+ 0.0,
+ 1401360285
+ ],
+ [
+ 0.0,
+ 1401360300
+ ],
+ [
+ 0.0,
+ 1401360315
+ ],
+ [
+ 0.0,
+ 1401360330
+ ],
+ [
+ 0.0,
+ 1401360345
+ ],
+ [
+ 0.0,
+ 1401360360
+ ],
+ [
+ 0.0,
+ 1401360375
+ ],
+ [
+ 0.0,
+ 1401360390
+ ],
+ [
+ 0.0,
+ 1401360405
+ ],
+ [
+ 0.0,
+ 1401360420
+ ],
+ [
+ 0.0,
+ 1401360435
+ ],
+ [
+ 0.0,
+ 1401360450
+ ],
+ [
+ 0.0,
+ 1401360465
+ ],
+ [
+ 0.0,
+ 1401360480
+ ],
+ [
+ 0.0,
+ 1401360495
+ ],
+ [
+ 0.0,
+ 1401360510
+ ],
+ [
+ 0.0,
+ 1401360525
+ ],
+ [
+ 0.0,
+ 1401360540
+ ],
+ [
+ 0.0,
+ 1401360555
+ ],
+ [
+ 0.0,
+ 1401360570
+ ],
+ [
+ 0.0,
+ 1401360585
+ ],
+ [
+ 0.0,
+ 1401360600
+ ],
+ [
+ 0.0,
+ 1401360615
+ ],
+ [
+ 0.0,
+ 1401360630
+ ],
+ [
+ 0.0,
+ 1401360645
+ ],
+ [
+ 0.0,
+ 1401360660
+ ],
+ [
+ 0.0,
+ 1401360675
+ ],
+ [
+ 0.0,
+ 1401360690
+ ],
+ [
+ 0.0,
+ 1401360705
+ ],
+ [
+ 0.0,
+ 1401360720
+ ],
+ [
+ 0.0,
+ 1401360735
+ ],
+ [
+ 0.0,
+ 1401360750
+ ],
+ [
+ 0.0,
+ 1401360765
+ ],
+ [
+ 0.0,
+ 1401360780
+ ],
+ [
+ 0.0,
+ 1401360795
+ ],
+ [
+ 0.0,
+ 1401360810
+ ],
+ [
+ 0.0,
+ 1401360825
+ ],
+ [
+ 0.0,
+ 1401360840
+ ],
+ [
+ 0.0,
+ 1401360855
+ ],
+ [
+ 0.0,
+ 1401360870
+ ],
+ [
+ 0.0,
+ 1401360885
+ ],
+ [
+ 0.0,
+ 1401360900
+ ],
+ [
+ 0.0,
+ 1401360915
+ ],
+ [
+ 0.0,
+ 1401360930
+ ],
+ [
+ 0.0,
+ 1401360945
+ ],
+ [
+ 0.0,
+ 1401360960
+ ],
+ [
+ 0.0,
+ 1401360975
+ ],
+ [
+ 0.0,
+ 1401360990
+ ],
+ [
+ 0.0,
+ 1401361005
+ ],
+ [
+ 0.0,
+ 1401361020
+ ],
+ [
+ 0.0,
+ 1401361035
+ ],
+ [
+ 0.0,
+ 1401361050
+ ],
+ [
+ 0.0,
+ 1401361065
+ ],
+ [
+ 0.0,
+ 1401361080
+ ],
+ [
+ 0.0,
+ 1401361095
+ ],
+ [
+ 0.0,
+ 1401361110
+ ],
+ [
+ 0.0,
+ 1401361125
+ ],
+ [
+ 0.0,
+ 1401361140
+ ],
+ [
+ 0.0,
+ 1401361155
+ ],
+ [
+ 0.0,
+ 1401361170
+ ],
+ [
+ 0.0,
+ 1401361185
+ ],
+ [
+ 0.0,
+ 1401361200
+ ],
+ [
+ 0.0,
+ 1401361215
+ ],
+ [
+ 0.0,
+ 1401361230
+ ],
+ [
+ 0.0,
+ 1401361245
+ ],
+ [
+ 0.0,
+ 1401361260
+ ],
+ [
+ 0.0,
+ 1401361275
+ ],
+ [
+ 0.0,
+ 1401361290
+ ],
+ [
+ 0.0,
+ 1401361305
+ ],
+ [
+ 0.0,
+ 1401361320
+ ],
+ [
+ 0.0,
+ 1401361335
+ ],
+ [
+ 0.0,
+ 1401361350
+ ],
+ [
+ 0.0,
+ 1401361365
+ ],
+ [
+ 0.0,
+ 1401361380
+ ],
+ [
+ 0.0,
+ 1401361395
+ ],
+ [
+ 0.0,
+ 1401361410
+ ],
+ [
+ 0.0,
+ 1401361425
+ ],
+ [
+ 0.0,
+ 1401361440
+ ],
+ [
+ 0.0,
+ 1401361455
+ ],
+ [
+ 0.0,
+ 1401361470
+ ],
+ [
+ 0.0,
+ 1401361485
+ ],
+ [
+ 0.0,
+ 1401361500
+ ],
+ [
+ 0.0,
+ 1401361515
+ ],
+ [
+ 0.0,
+ 1401361530
+ ],
+ [
+ 0.0,
+ 1401361545
+ ],
+ [
+ 0.0,
+ 1401361560
+ ],
+ [
+ 0.0,
+ 1401361575
+ ],
+ [
+ 0.0,
+ 1401361590
+ ],
+ [
+ 0.0,
+ 1401361605
+ ],
+ [
+ 0.0,
+ 1401361620
+ ],
+ [
+ 0.0,
+ 1401361635
+ ],
+ [
+ 0.0,
+ 1401361650
+ ],
+ [
+ 0.0,
+ 1401361665
+ ],
+ [
+ 0.0,
+ 1401361680
+ ],
+ [
+ 0.0,
+ 1401361695
+ ],
+ [
+ 0.0,
+ 1401361710
+ ],
+ [
+ 0.0,
+ 1401361725
+ ],
+ [
+ 0.0,
+ 1401361740
+ ],
+ [
+ 0.0,
+ 1401361755
+ ],
+ [
+ 0.0,
+ 1401361770
+ ],
+ [
+ 0.0,
+ 1401361785
+ ],
+ [
+ 0.0,
+ 1401361800
+ ],
+ [
+ 0.0,
+ 1401361815
+ ],
+ [
+ 0.0,
+ 1401361830
+ ],
+ [
+ 0.0,
+ 1401361845
+ ],
+ [
+ 0.0,
+ 1401361860
+ ],
+ [
+ 0.0,
+ 1401361875
+ ],
+ [
+ 0.0,
+ 1401361890
+ ],
+ [
+ 0.0,
+ 1401361905
+ ],
+ [
+ 0.0,
+ 1401361920
+ ],
+ [
+ 0.0,
+ 1401361935
+ ],
+ [
+ 0.08,
+ 1401361950
+ ],
+ [
+ 0.0533333333333,
+ 1401361965
+ ],
+ [
+ 0.0,
+ 1401361980
+ ],
+ [
+ 0.0,
+ 1401361995
+ ],
+ [
+ 0.0,
+ 1401362010
+ ],
+ [
+ 0.0,
+ 1401362025
+ ],
+ [
+ 0.0,
+ 1401362040
+ ],
+ [
+ 0.0,
+ 1401362055
+ ],
+ [
+ 0.0,
+ 1401362070
+ ],
+ [
+ 0.0,
+ 1401362085
+ ],
+ [
+ 0.0,
+ 1401362100
+ ],
+ [
+ 0.0,
+ 1401362115
+ ],
+ [
+ 0.0,
+ 1401362130
+ ],
+ [
+ 0.0,
+ 1401362145
+ ],
+ [
+ 0.0,
+ 1401362160
+ ],
+ [
+ 0.0,
+ 1401362175
+ ],
+ [
+ 0.0,
+ 1401362190
+ ],
+ [
+ 0.0,
+ 1401362205
+ ],
+ [
+ 0.0,
+ 1401362220
+ ],
+ [
+ 0.0,
+ 1401362235
+ ],
+ [
+ 0.0,
+ 1401362250
+ ],
+ [
+ 0.0,
+ 1401362265
+ ],
+ [
+ 0.0,
+ 1401362280
+ ],
+ [
+ 0.0,
+ 1401362295
+ ],
+ [
+ 0.0,
+ 1401362310
+ ],
+ [
+ 0.0,
+ 1401362325
+ ],
+ [
+ 0.0,
+ 1401362340
+ ],
+ [
+ 0.0,
+ 1401362355
+ ],
+ [
+ 0.0,
+ 1401362370
+ ],
+ [
+ 0.0,
+ 1401362385
+ ],
+ [
+ 0.0,
+ 1401362400
+ ],
+ [
+ 0.0,
+ 1401362415
+ ],
+ [
+ 0.0,
+ 1401362430
+ ],
+ [
+ 0.0,
+ 1401362445
+ ],
+ [
+ 0.0,
+ 1401362460
+ ],
+ [
+ 0.0,
+ 1401362475
+ ],
+ [
+ 0.0,
+ 1401362490
+ ],
+ [
+ 0.0,
+ 1401362505
+ ],
+ [
+ 0.0,
+ 1401362520
+ ],
+ [
+ 0.0,
+ 1401362535
+ ],
+ [
+ 0.0,
+ 1401362550
+ ],
+ [
+ 0.0,
+ 1401362565
+ ],
+ [
+ 0.0,
+ 1401362580
+ ],
+ [
+ 0.0,
+ 1401362595
+ ],
+ [
+ 0.0,
+ 1401362610
+ ],
+ [
+ 0.0,
+ 1401362625
+ ],
+ [
+ 0.0,
+ 1401362640
+ ],
+ [
+ 0.0,
+ 1401362655
+ ],
+ [
+ 0.0,
+ 1401362670
+ ],
+ [
+ 0.0,
+ 1401362685
+ ]
+ ],
+ "FileInfoOps" : [
+ [
+ 0.0,
+ 1401359340
+ ],
+ [
+ 0.0,
+ 1401359355
+ ],
+ [
+ 0.0,
+ 1401359370
+ ],
+ [
+ 0.0,
+ 1401359385
+ ],
+ [
+ 0.0,
+ 1401359400
+ ],
+ [
+ 0.0,
+ 1401359415
+ ],
+ [
+ 0.0,
+ 1401359430
+ ],
+ [
+ 0.0,
+ 1401359445
+ ],
+ [
+ 0.0,
+ 1401359460
+ ],
+ [
+ 0.0,
+ 1401359475
+ ],
+ [
+ 0.0,
+ 1401359490
+ ],
+ [
+ 0.0,
+ 1401359505
+ ],
+ [
+ 0.0177777777778,
+ 1401359520
+ ],
+ [
+ 0.115555555556,
+ 1401359535
+ ],
+ [
+ 0.0,
+ 1401359550
+ ],
+ [
+ 0.0,
+ 1401359565
+ ],
+ [
+ 0.0,
+ 1401359580
+ ],
+ [
+ 0.0,
+ 1401359595
+ ],
+ [
+ 0.0,
+ 1401359610
+ ],
+ [
+ 0.0,
+ 1401359625
+ ],
+ [
+ 0.0,
+ 1401359640
+ ],
+ [
+ 0.0,
+ 1401359655
+ ],
+ [
+ 0.0,
+ 1401359670
+ ],
+ [
+ 0.0,
+ 1401359685
+ ],
+ [
+ 0.0,
+ 1401359700
+ ],
+ [
+ 0.0,
+ 1401359715
+ ],
+ [
+ 0.0,
+ 1401359730
+ ],
+ [
+ 0.0,
+ 1401359745
+ ],
+ [
+ 0.0,
+ 1401359760
+ ],
+ [
+ 0.0,
+ 1401359775
+ ],
+ [
+ 0.0,
+ 1401359790
+ ],
+ [
+ 0.0,
+ 1401359805
+ ],
+ [
+ 0.025,
+ 1401359820
+ ],
+ [
+ 0.108333333333,
+ 1401359835
+ ],
+ [
+ 0.0,
+ 1401359850
+ ],
+ [
+ 0.0,
+ 1401359865
+ ],
+ [
+ 0.0,
+ 1401359880
+ ],
+ [
+ 0.0,
+ 1401359895
+ ],
+ [
+ 0.0,
+ 1401359910
+ ],
+ [
+ 0.0,
+ 1401359925
+ ],
+ [
+ 0.0,
+ 1401359940
+ ],
+ [
+ 0.0,
+ 1401359955
+ ],
+ [
+ 0.0,
+ 1401359970
+ ],
+ [
+ 0.0,
+ 1401359985
+ ],
+ [
+ 0.0,
+ 1401360000
+ ],
+ [
+ 0.0,
+ 1401360015
+ ],
+ [
+ 0.0,
+ 1401360030
+ ],
+ [
+ 0.0,
+ 1401360045
+ ],
+ [
+ 0.0,
+ 1401360060
+ ],
+ [
+ 0.0,
+ 1401360075
+ ],
+ [
+ 0.0,
+ 1401360090
+ ],
+ [
+ 0.0,
+ 1401360105
+ ],
+ [
+ 0.0,
+ 1401360120
+ ],
+ [
+ 0.133333333333,
+ 1401360135
+ ],
+ [
+ 0.0,
+ 1401360150
+ ],
+ [
+ 0.0,
+ 1401360165
+ ],
+ [
+ 0.0,
+ 1401360180
+ ],
+ [
+ 0.0,
+ 1401360195
+ ],
+ [
+ 0.0,
+ 1401360210
+ ],
+ [
+ 0.0,
+ 1401360225
+ ],
+ [
+ 0.0,
+ 1401360240
+ ],
+ [
+ 0.0,
+ 1401360255
+ ],
+ [
+ 0.0,
+ 1401360270
+ ],
+ [
+ 0.0,
+ 1401360285
+ ],
+ [
+ 0.0,
+ 1401360300
+ ],
+ [
+ 0.0,
+ 1401360315
+ ],
+ [
+ 0.0,
+ 1401360330
+ ],
+ [
+ 0.0,
+ 1401360345
+ ],
+ [
+ 0.0,
+ 1401360360
+ ],
+ [
+ 0.0,
+ 1401360375
+ ],
+ [
+ 0.0,
+ 1401360390
+ ],
+ [
+ 0.0,
+ 1401360405
+ ],
+ [
+ 0.108333333333,
+ 1401360420
+ ],
+ [
+ 0.025,
+ 1401360435
+ ],
+ [
+ 0.0,
+ 1401360450
+ ],
+ [
+ 0.0,
+ 1401360465
+ ],
+ [
+ 0.0,
+ 1401360480
+ ],
+ [
+ 0.0,
+ 1401360495
+ ],
+ [
+ 0.0,
+ 1401360510
+ ],
+ [
+ 0.0,
+ 1401360525
+ ],
+ [
+ 0.0,
+ 1401360540
+ ],
+ [
+ 0.0,
+ 1401360555
+ ],
+ [
+ 0.0,
+ 1401360570
+ ],
+ [
+ 0.0,
+ 1401360585
+ ],
+ [
+ 0.0,
+ 1401360600
+ ],
+ [
+ 0.0,
+ 1401360615
+ ],
+ [
+ 0.0,
+ 1401360630
+ ],
+ [
+ 0.0,
+ 1401360645
+ ],
+ [
+ 0.0,
+ 1401360660
+ ],
+ [
+ 0.0,
+ 1401360675
+ ],
+ [
+ 0.0,
+ 1401360690
+ ],
+ [
+ 0.0,
+ 1401360705
+ ],
+ [
+ 0.0,
+ 1401360720
+ ],
+ [
+ 0.12380952381,
+ 1401360735
+ ],
+ [
+ 0.00952380952381,
+ 1401360750
+ ],
+ [
+ 0.0,
+ 1401360765
+ ],
+ [
+ 0.0,
+ 1401360780
+ ],
+ [
+ 0.0,
+ 1401360795
+ ],
+ [
+ 0.0,
+ 1401360810
+ ],
+ [
+ 0.0,
+ 1401360825
+ ],
+ [
+ 0.0,
+ 1401360840
+ ],
+ [
+ 0.0,
+ 1401360855
+ ],
+ [
+ 0.0,
+ 1401360870
+ ],
+ [
+ 0.0,
+ 1401360885
+ ],
+ [
+ 0.0,
+ 1401360900
+ ],
+ [
+ 0.0,
+ 1401360915
+ ],
+ [
+ 0.0,
+ 1401360930
+ ],
+ [
+ 0.0,
+ 1401360945
+ ],
+ [
+ 0.0,
+ 1401360960
+ ],
+ [
+ 0.0,
+ 1401360975
+ ],
+ [
+ 0.0,
+ 1401360990
+ ],
+ [
+ 0.0,
+ 1401361005
+ ],
+ [
+ 0.0,
+ 1401361020
+ ],
+ [
+ 0.115555555556,
+ 1401361035
+ ],
+ [
+ 0.0177777777778,
+ 1401361050
+ ],
+ [
+ 0.0,
+ 1401361065
+ ],
+ [
+ 0.0,
+ 1401361080
+ ],
+ [
+ 0.0,
+ 1401361095
+ ],
+ [
+ 0.0,
+ 1401361110
+ ],
+ [
+ 0.0,
+ 1401361125
+ ],
+ [
+ 0.0,
+ 1401361140
+ ],
+ [
+ 0.0,
+ 1401361155
+ ],
+ [
+ 0.0,
+ 1401361170
+ ],
+ [
+ 0.0,
+ 1401361185
+ ],
+ [
+ 0.0,
+ 1401361200
+ ],
+ [
+ 0.0,
+ 1401361215
+ ],
+ [
+ 0.0,
+ 1401361230
+ ],
+ [
+ 0.0,
+ 1401361245
+ ],
+ [
+ 0.0,
+ 1401361260
+ ],
+ [
+ 0.0,
+ 1401361275
+ ],
+ [
+ 0.0,
+ 1401361290
+ ],
+ [
+ 0.0,
+ 1401361305
+ ],
+ [
+ 0.0888888888889,
+ 1401361320
+ ],
+ [
+ 0.0444444444444,
+ 1401361335
+ ],
+ [
+ 0.0,
+ 1401361350
+ ],
+ [
+ 0.0,
+ 1401361365
+ ],
+ [
+ 0.0,
+ 1401361380
+ ],
+ [
+ 0.0,
+ 1401361395
+ ],
+ [
+ 0.0,
+ 1401361410
+ ],
+ [
+ 0.0,
+ 1401361425
+ ],
+ [
+ 0.0,
+ 1401361440
+ ],
+ [
+ 0.0,
+ 1401361455
+ ],
+ [
+ 0.0,
+ 1401361470
+ ],
+ [
+ 0.0,
+ 1401361485
+ ],
+ [
+ 0.0,
+ 1401361500
+ ],
+ [
+ 0.0,
+ 1401361515
+ ],
+ [
+ 0.0,
+ 1401361530
+ ],
+ [
+ 0.0,
+ 1401361545
+ ],
+ [
+ 0.0,
+ 1401361560
+ ],
+ [
+ 0.0,
+ 1401361575
+ ],
+ [
+ 0.0,
+ 1401361590
+ ],
+ [
+ 0.0,
+ 1401361605
+ ],
+ [
+ 0.075,
+ 1401361620
+ ],
+ [
+ 0.0583333333333,
+ 1401361635
+ ],
+ [
+ 0.0,
+ 1401361650
+ ],
+ [
+ 0.0,
+ 1401361665
+ ],
+ [
+ 0.0,
+ 1401361680
+ ],
+ [
+ 0.0,
+ 1401361695
+ ],
+ [
+ 0.0,
+ 1401361710
+ ],
+ [
+ 0.0,
+ 1401361725
+ ],
+ [
+ 0.0,
+ 1401361740
+ ],
+ [
+ 0.0,
+ 1401361755
+ ],
+ [
+ 0.0,
+ 1401361770
+ ],
+ [
+ 0.0,
+ 1401361785
+ ],
+ [
+ 0.0,
+ 1401361800
+ ],
+ [
+ 0.0,
+ 1401361815
+ ],
+ [
+ 0.0,
+ 1401361830
+ ],
+ [
+ 0.0,
+ 1401361845
+ ],
+ [
+ 0.0,
+ 1401361860
+ ],
+ [
+ 0.0,
+ 1401361875
+ ],
+ [
+ 0.0,
+ 1401361890
+ ],
+ [
+ 0.0,
+ 1401361905
+ ],
+ [
+ 0.08,
+ 1401361920
+ ],
+ [
+ 0.0533333333333,
+ 1401361935
+ ],
+ [
+ 0.24,
+ 1401361950
+ ],
+ [
+ 0.16,
+ 1401361965
+ ],
+ [
+ 0.0,
+ 1401361980
+ ],
+ [
+ 0.0,
+ 1401361995
+ ],
+ [
+ 0.0,
+ 1401362010
+ ],
+ [
+ 0.0,
+ 1401362025
+ ],
+ [
+ 0.0,
+ 1401362040
+ ],
+ [
+ 0.0,
+ 1401362055
+ ],
+ [
+ 0.0,
+ 1401362070
+ ],
+ [
+ 0.0,
+ 1401362085
+ ],
+ [
+ 0.0,
+ 1401362100
+ ],
+ [
+ 0.0,
+ 1401362115
+ ],
+ [
+ 0.0,
+ 1401362130
+ ],
+ [
+ 0.0,
+ 1401362145
+ ],
+ [
+ 0.0,
+ 1401362160
+ ],
+ [
+ 0.0,
+ 1401362175
+ ],
+ [
+ 0.0,
+ 1401362190
+ ],
+ [
+ 0.0,
+ 1401362205
+ ],
+ [
+ 0.106666666667,
+ 1401362220
+ ],
+ [
+ 0.0266666666667,
+ 1401362235
+ ],
+ [
+ 0.0,
+ 1401362250
+ ],
+ [
+ 0.0,
+ 1401362265
+ ],
+ [
+ 0.0,
+ 1401362280
+ ],
+ [
+ 0.0,
+ 1401362295
+ ],
+ [
+ 0.0,
+ 1401362310
+ ],
+ [
+ 0.0,
+ 1401362325
+ ],
+ [
+ 0.0,
+ 1401362340
+ ],
+ [
+ 0.0,
+ 1401362355
+ ],
+ [
+ 0.0,
+ 1401362370
+ ],
+ [
+ 0.0,
+ 1401362385
+ ],
+ [
+ 0.0,
+ 1401362400
+ ],
+ [
+ 0.0,
+ 1401362415
+ ],
+ [
+ 0.0,
+ 1401362430
+ ],
+ [
+ 0.0,
+ 1401362445
+ ],
+ [
+ 0.0,
+ 1401362460
+ ],
+ [
+ 0.0,
+ 1401362475
+ ],
+ [
+ 0.0,
+ 1401362490
+ ],
+ [
+ 0.0,
+ 1401362505
+ ],
+ [
+ 0.0,
+ 1401362520
+ ],
+ [
+ 0.115555555556,
+ 1401362535
+ ],
+ [
+ 0.0177777777778,
+ 1401362550
+ ],
+ [
+ 0.0,
+ 1401362565
+ ],
+ [
+ 0.106666666667,
+ 1401362580
+ ],
+ [
+ 0.0266666666667,
+ 1401362595
+ ],
+ [
+ 0.0,
+ 1401362610
+ ],
+ [
+ 0.0,
+ 1401362625
+ ],
+ [
+ 0.0,
+ 1401362640
+ ],
+ [
+ 0.0,
+ 1401362655
+ ],
+ [
+ 0.0,
+ 1401362670
+ ],
+ [
+ 0.0,
+ 1401362685
+ ],
+ [
+ 0.0,
+ 1401362700
+ ],
+ [
+ 0.0,
+ 1401362715
+ ],
+ [
+ 0.0,
+ 1401362730
+ ],
+ [
+ 0.0,
+ 1401362745
+ ],
+ [
+ 0.0,
+ 1401362760
+ ],
+ [
+ 0.0,
+ 1401362775
+ ],
+ [
+ 0.0,
+ 1401362790
+ ],
+ [
+ 0.0,
+ 1401362805
+ ],
+ [
+ 0.0888888888889,
+ 1401362820
+ ],
+ [
+ 0.0444444444444,
+ 1401362835
+ ],
+ [
+ 0.0,
+ 1401362850
+ ],
+ [
+ 0.0,
+ 1401362865
+ ],
+ [
+ 0.0,
+ 1401362880
+ ]
+ ]
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric4.json
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric4.json b/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric4.json
new file mode 100644
index 0000000..ec74f7d
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/assets/data/metrics/metric4.json
@@ -0,0 +1,968 @@
+{
+ "metrics" : {
+ "rpc" : {
+ "RpcQueueTime_avg_time" : [
+ [
+ 0.0,
+ 1401359595
+ ],
+ [
+ 0.0666666666667,
+ 1401359610
+ ],
+ [
+ 0.933333333333,
+ 1401359625
+ ],
+ [
+ 0.0333333333333,
+ 1401359640
+ ],
+ [
+ 0.466666666667,
+ 1401359655
+ ],
+ [
+ 0.0,
+ 1401359670
+ ],
+ [
+ 0.0666666666667,
+ 1401359685
+ ],
+ [
+ 0.933333333333,
+ 1401359700
+ ],
+ [
+ 0.477777777778,
+ 1401359715
+ ],
+ [
+ 0.466666666667,
+ 1401359730
+ ],
+ [
+ 0.933333333333,
+ 1401359745
+ ],
+ [
+ 0.477777777778,
+ 1401359760
+ ],
+ [
+ 0.311111111111,
+ 1401359775
+ ],
+ [
+ 0.0,
+ 1401359790
+ ],
+ [
+ 0.0,
+ 1401359805
+ ],
+ [
+ 0.0,
+ 1401359820
+ ],
+ [
+ 0.0333333333333,
+ 1401359835
+ ],
+ [
+ 0.216666666667,
+ 1401359850
+ ],
+ [
+ 0.0,
+ 1401359865
+ ],
+ [
+ 0.0266666666667,
+ 1401359880
+ ],
+ [
+ 0.36,
+ 1401359895
+ ],
+ [
+ 0.8,
+ 1401359910
+ ],
+ [
+ 0.0,
+ 1401359925
+ ],
+ [
+ 0.0666666666667,
+ 1401359940
+ ],
+ [
+ 0.5,
+ 1401359955
+ ],
+ [
+ 0.5,
+ 1401359970
+ ],
+ [
+ 0.0,
+ 1401359985
+ ],
+ [
+ 0.0,
+ 1401360000
+ ],
+ [
+ 0.5,
+ 1401360015
+ ],
+ [
+ 0.0,
+ 1401360030
+ ],
+ [
+ 0.0,
+ 1401360045
+ ],
+ [
+ 0.0,
+ 1401360060
+ ],
+ [
+ 0.0,
+ 1401360075
+ ],
+ [
+ 0.0,
+ 1401360090
+ ],
+ [
+ 0.0,
+ 1401360105
+ ],
+ [
+ 0.0,
+ 1401360120
+ ],
+ [
+ 0.333333333333,
+ 1401360135
+ ],
+ [
+ 0.5,
+ 1401360150
+ ],
+ [
+ 0.0333333333333,
+ 1401360165
+ ],
+ [
+ 0.0,
+ 1401360180
+ ],
+ [
+ 0.933333333333,
+ 1401360195
+ ],
+ [
+ 0.422222222222,
+ 1401360210
+ ],
+ [
+ 0.0444444444444,
+ 1401360225
+ ],
+ [
+ 0.0,
+ 1401360240
+ ],
+ [
+ 0.0,
+ 1401360255
+ ],
+ [
+ 0.433333333333,
+ 1401360270
+ ],
+ [
+ 0.5,
+ 1401360285
+ ],
+ [
+ 0.0333333333333,
+ 1401360300
+ ],
+ [
+ 0.0,
+ 1401360315
+ ],
+ [
+ 0.0,
+ 1401360330
+ ],
+ [
+ 0.8,
+ 1401360345
+ ],
+ [
+ 0.2,
+ 1401360360
+ ],
+ [
+ 0.0,
+ 1401360375
+ ],
+ [
+ 0.866666666667,
+ 1401360390
+ ],
+ [
+ 0.133333333333,
+ 1401360405
+ ],
+ [
+ 0.0,
+ 1401360420
+ ],
+ [
+ 0.0,
+ 1401360435
+ ],
+ [
+ 0.0,
+ 1401360450
+ ],
+ [
+ 0.0,
+ 1401360465
+ ],
+ [
+ 0.0,
+ 1401360480
+ ],
+ [
+ 0.4,
+ 1401360495
+ ],
+ [
+ 0.9,
+ 1401360510
+ ],
+ [
+ 1.0,
+ 1401360525
+ ],
+ [
+ 0.266666666667,
+ 1401360540
+ ],
+ [
+ 0.0,
+ 1401360555
+ ],
+ [
+ 0.0,
+ 1401360570
+ ],
+ [
+ 0.0,
+ 1401360585
+ ],
+ [
+ 0.0,
+ 1401360600
+ ],
+ [
+ 0.4,
+ 1401360615
+ ],
+ [
+ 0.9,
+ 1401360630
+ ],
+ [
+ 0.2,
+ 1401360645
+ ],
+ [
+ 0.0,
+ 1401360660
+ ],
+ [
+ 0.0,
+ 1401360675
+ ],
+ [
+ 0.0,
+ 1401360690
+ ],
+ [
+ 0.8,
+ 1401360705
+ ],
+ [
+ 0.566666666667,
+ 1401360720
+ ],
+ [
+ 0.0666666666667,
+ 1401360735
+ ],
+ [
+ 0.0,
+ 1401360750
+ ],
+ [
+ 0.0,
+ 1401360765
+ ],
+ [
+ 0.0,
+ 1401360780
+ ],
+ [
+ 0.0,
+ 1401360795
+ ],
+ [
+ 0.0,
+ 1401360810
+ ],
+ [
+ 0.0,
+ 1401360825
+ ],
+ [
+ 0.0,
+ 1401360840
+ ],
+ [
+ 0.0,
+ 1401360855
+ ],
+ [
+ 0.0,
+ 1401360870
+ ],
+ [
+ 0.733333333333,
+ 1401360885
+ ],
+ [
+ 0.4,
+ 1401360900
+ ],
+ [
+ 0.8,
+ 1401360915
+ ],
+ [
+ 0.266666666667,
+ 1401360930
+ ],
+ [
+ 0.4,
+ 1401360945
+ ],
+ [
+ 0.9,
+ 1401360960
+ ],
+ [
+ 0.2,
+ 1401360975
+ ],
+ [
+ 0.4,
+ 1401360990
+ ],
+ [
+ 0.1,
+ 1401361005
+ ],
+ [
+ 0.0,
+ 1401361020
+ ],
+ [
+ 0.0,
+ 1401361035
+ ],
+ [
+ 0.0,
+ 1401361050
+ ],
+ [
+ 0.0,
+ 1401361065
+ ],
+ [
+ 0.0,
+ 1401361080
+ ],
+ [
+ 0.0,
+ 1401361095
+ ],
+ [
+ 0.0,
+ 1401361110
+ ],
+ [
+ 0.0,
+ 1401361125
+ ],
+ [
+ 0.0,
+ 1401361140
+ ],
+ [
+ 0.0,
+ 1401361155
+ ],
+ [
+ 0.0,
+ 1401361170
+ ],
+ [
+ 0.733333333333,
+ 1401361185
+ ],
+ [
+ 0.333333333333,
+ 1401361200
+ ],
+ [
+ 0.0,
+ 1401361215
+ ],
+ [
+ 0.333333333333,
+ 1401361230
+ ],
+ [
+ 0.866666666667,
+ 1401361245
+ ],
+ [
+ 0.266666666667,
+ 1401361260
+ ],
+ [
+ 0.0,
+ 1401361275
+ ],
+ [
+ 0.733333333333,
+ 1401361290
+ ],
+ [
+ 0.633333333333,
+ 1401361305
+ ],
+ [
+ 0.833333333333,
+ 1401361320
+ ],
+ [
+ 0.333333333333,
+ 1401361335
+ ],
+ [
+ 0.0,
+ 1401361350
+ ],
+ [
+ 0.0,
+ 1401361365
+ ],
+ [
+ 0.183333333333,
+ 1401361380
+ ],
+ [
+ 0.75,
+ 1401361395
+ ],
+ [
+ 0.266666666667,
+ 1401361410
+ ],
+ [
+ 0.666666666667,
+ 1401361425
+ ],
+ [
+ 0.333333333333,
+ 1401361440
+ ],
+ [
+ 0.0,
+ 1401361455
+ ],
+ [
+ 0.6,
+ 1401361470
+ ],
+ [
+ 0.466666666667,
+ 1401361485
+ ],
+ [
+ 0.6,
+ 1401361500
+ ],
+ [
+ 0.4,
+ 1401361515
+ ],
+ [
+ 0.0,
+ 1401361530
+ ],
+ [
+ 0.0,
+ 1401361545
+ ],
+ [
+ 0.0,
+ 1401361560
+ ],
+ [
+ 0.0,
+ 1401361575
+ ],
+ [
+ 0.0,
+ 1401361590
+ ],
+ [
+ 0.0,
+ 1401361605
+ ],
+ [
+ 0.0,
+ 1401361620
+ ],
+ [
+ 0.533333333333,
+ 1401361635
+ ],
+ [
+ 0.4,
+ 1401361650
+ ],
+ [
+ 0.0,
+ 1401361665
+ ],
+ [
+ 0.0,
+ 1401361680
+ ],
+ [
+ 0.0,
+ 1401361695
+ ],
+ [
+ 0.0,
+ 1401361710
+ ],
+ [
+ 0.0,
+ 1401361725
+ ],
+ [
+ 0.0,
+ 1401361740
+ ],
+ [
+ 0.0,
+ 1401361755
+ ],
+ [
+ 0.0,
+ 1401361770
+ ],
+ [
+ 0.0,
+ 1401361785
+ ],
+ [
+ 0.0,
+ 1401361800
+ ],
+ [
+ 0.0,
+ 1401361815
+ ],
+ [
+ 0.666666666667,
+ 1401361830
+ ],
+ [
+ 0.333333333333,
+ 1401361845
+ ],
+ [
+ 0.0,
+ 1401361860
+ ],
+ [
+ 0.0,
+ 1401361875
+ ],
+ [
+ 0.333333333333,
+ 1401361890
+ ],
+ [
+ 0.2,
+ 1401361905
+ ],
+ [
+ 0.6,
+ 1401361920
+ ],
+ [
+ 0.4,
+ 1401361935
+ ],
+ [
+ 0.0,
+ 1401361950
+ ],
+ [
+ 0.0,
+ 1401361965
+ ],
+ [
+ 0.6,
+ 1401361980
+ ],
+ [
+ 0.4,
+ 1401361995
+ ],
+ [
+ 0.0,
+ 1401362010
+ ],
+ [
+ 0.0,
+ 1401362025
+ ],
+ [
+ 0.0,
+ 1401362040
+ ],
+ [
+ 0.0,
+ 1401362055
+ ],
+ [
+ 0.0,
+ 1401362070
+ ],
+ [
+ 0.0,
+ 1401362085
+ ],
+ [
+ 0.666666666667,
+ 1401362100
+ ],
+ [
+ 0.333333333333,
+ 1401362115
+ ],
+ [
+ 0.0,
+ 1401362130
+ ],
+ [
+ 0.0,
+ 1401362145
+ ],
+ [
+ 0.183333333333,
+ 1401362160
+ ],
+ [
+ 0.0833333333333,
+ 1401362175
+ ],
+ [
+ 0.0,
+ 1401362190
+ ],
+ [
+ 0.0,
+ 1401362205
+ ],
+ [
+ 0.8,
+ 1401362220
+ ],
+ [
+ 0.2,
+ 1401362235
+ ],
+ [
+ 0.0,
+ 1401362250
+ ],
+ [
+ 0.0,
+ 1401362265
+ ],
+ [
+ 0.0,
+ 1401362280
+ ],
+ [
+ 0.0,
+ 1401362295
+ ],
+ [
+ 0.0,
+ 1401362310
+ ],
+ [
+ 0.0,
+ 1401362325
+ ],
+ [
+ 0.0,
+ 1401362340
+ ],
+ [
+ 0.0,
+ 1401362355
+ ],
+ [
+ 0.8,
+ 1401362370
+ ],
+ [
+ 0.2,
+ 1401362385
+ ],
+ [
+ 0.0,
+ 1401362400
+ ],
+ [
+ 0.0,
+ 1401362415
+ ],
+ [
+ 0.366666666667,
+ 1401362430
+ ],
+ [
+ 0.1,
+ 1401362445
+ ],
+ [
+ 0.0,
+ 1401362460
+ ],
+ [
+ 0.0,
+ 1401362475
+ ],
+ [
+ 0.0,
+ 1401362490
+ ],
+ [
+ 0.0,
+ 1401362505
+ ],
+ [
+ 0.288888888889,
+ 1401362520
+ ],
+ [
+ 0.0444444444444,
+ 1401362535
+ ],
+ [
+ 0.0,
+ 1401362550
+ ],
+ [
+ 0.8,
+ 1401362565
+ ],
+ [
+ 0.2,
+ 1401362580
+ ],
+ [
+ 0.0,
+ 1401362595
+ ],
+ [
+ 0.366666666667,
+ 1401362610
+ ],
+ [
+ 0.133333333333,
+ 1401362625
+ ],
+ [
+ 0.0,
+ 1401362640
+ ],
+ [
+ 0.0,
+ 1401362655
+ ],
+ [
+ 0.0,
+ 1401362670
+ ],
+ [
+ 0.0,
+ 1401362685
+ ],
+ [
+ 0.0,
+ 1401362700
+ ],
+ [
+ 0.0,
+ 1401362715
+ ],
+ [
+ 0.0,
+ 1401362730
+ ],
+ [
+ 0.0,
+ 1401362745
+ ],
+ [
+ 0.6,
+ 1401362760
+ ],
+ [
+ 0.333333333333,
+ 1401362775
+ ],
+ [
+ 0.3,
+ 1401362790
+ ],
+ [
+ 0.166666666667,
+ 1401362805
+ ],
+ [
+ 0.0,
+ 1401362820
+ ],
+ [
+ 0.0,
+ 1401362835
+ ],
+ [
+ 0.0,
+ 1401362850
+ ],
+ [
+ 0.0,
+ 1401362865
+ ],
+ [
+ 0.0,
+ 1401362880
+ ],
+ [
+ 0.0,
+ 1401362895
+ ],
+ [
+ 0.0,
+ 1401362910
+ ],
+ [
+ 0.0,
+ 1401362925
+ ],
+ [
+ 0.0,
+ 1401362940
+ ],
+ [
+ 0.0,
+ 1401362955
+ ],
+ [
+ 0.0,
+ 1401362970
+ ],
+ [
+ 0.0,
+ 1401362985
+ ],
+ [
+ 0.666666666667,
+ 1401363000
+ ],
+ [
+ 0.266666666667,
+ 1401363015
+ ],
+ [
+ 0.0,
+ 1401363030
+ ],
+ [
+ 0.0,
+ 1401363045
+ ],
+ [
+ 0.166666666667,
+ 1401363060
+ ],
+ [
+ 0.0833333333333,
+ 1401363075
+ ],
+ [
+ 0.0,
+ 1401363090
+ ],
+ [
+ 0.0,
+ 1401363105
+ ],
+ [
+ 0.0,
+ 1401363120
+ ],
+ [
+ 0.0,
+ 1401363135
+ ],
+ [
+ 0.166666666667,
+ 1401363150
+ ],
+ [
+ 0.0833333333333,
+ 1401363165
+ ],
+ [
+ 0.222222222222,
+ 1401363180
+ ]
+ ]
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js b/ambari-web/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
new file mode 100644
index 0000000..7e8d6e6
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.SliderAppSummaryController = Ember.Controller.extend({
+
+
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/helpers/string_utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/helpers/string_utils.js b/ambari-web/contrib/views/slider/src/main/resources/ui/app/helpers/string_utils.js
new file mode 100644
index 0000000..9675f49
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/helpers/string_utils.js
@@ -0,0 +1,163 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+module.exports = {
+
+ pad: function(str, len, pad, dir) {
+
+ var STR_PAD_LEFT = 1;
+ var STR_PAD_RIGHT = 2;
+ var STR_PAD_BOTH = 3;
+
+ if (typeof(len) == "undefined") { len = 0; }
+ if (typeof(pad) == "undefined") { pad = ' '; }
+ if (typeof(dir) == "undefined") { dir = STR_PAD_RIGHT; }
+
+ if (len + 1 >= str.length) {
+
+ switch (dir){
+
+ case STR_PAD_LEFT:
+ str = Array(len + 1 - str.length).join(pad) + str;
+ break;
+
+ case STR_PAD_BOTH:
+ var padlen = len - str.length;
+ var right = Math.ceil((padlen) / 2);
+ var left = padlen - right;
+ str = Array(left+1).join(pad) + str + Array(right+1).join(pad);
+ break;
+
+ default:
+ str = str + Array(len + 1 - str.length).join(pad);
+ break;
+
+ } // switch
+
+ }
+ return str;
+
+ },
+ underScoreToCamelCase: function(name){
+ function replacer(str, p1, p2, offset, s) {
+ return str[1].toUpperCase();
+ }
+ return name.replace(/_\w/g,replacer);
+ },
+
+ /**
+ * Forces given string into upper camel-case representation. The first
+ * character of each word will be capitalized with the rest in lower case.
+ */
+ getCamelCase : function(name) {
+ if (name != null) {
+ return name.toLowerCase().replace(/(\b\w)/g, function(f) {
+ return f.toUpperCase();
+ })
+ }
+ return name;
+ },
+
+ /**
+ * Compare two versions by following rules:
+ * first higher than second then return 1
+ * first lower than second then return -1
+ * first equal to second then return 0
+ * @param first {string}
+ * @param second {string}
+ * @return {number}
+ */
+ compareVersions: function(first, second){
+ if (!(typeof first === 'string' && typeof second === 'string')) {
+ return false;
+ }
+ if (first === '' || second === '') {
+ return false;
+ }
+ var firstNumbers = first.split('.');
+ var secondNumbers = second.split('.');
+ var length = 0;
+ var i = 0;
+ var result = false;
+ if(firstNumbers.length === secondNumbers.length) {
+ length = firstNumbers.length;
+ } else if(firstNumbers.length < secondNumbers.length){
+ length = secondNumbers.length;
+ } else {
+ length = firstNumbers.length;
+ }
+
+ while(i < length && !result){
+ firstNumbers[i] = (firstNumbers[i] === undefined) ? 0 : window.parseInt(firstNumbers[i]);
+ secondNumbers[i] = (secondNumbers[i] === undefined) ? 0 : window.parseInt(secondNumbers[i]);
+ if(firstNumbers[i] > secondNumbers[i]){
+ result = 1;
+ break;
+ } else if(firstNumbers[i] === secondNumbers[i]){
+ result = 0;
+ } else if(firstNumbers[i] < secondNumbers[i]){
+ result = -1;
+ break;
+ }
+ i++;
+ }
+ return result;
+ },
+
+ isSingleLine: function(string){
+ return String(string).trim().indexOf("\n") == -1;
+ },
+ /**
+ * transform array of objects into CSV format content
+ * @param array
+ * @return {Array}
+ */
+ arrayToCSV: function(array){
+ var content = "";
+ array.forEach(function(item){
+ var row = [];
+ for(var i in item){
+ if(item.hasOwnProperty(i)){
+ row.push(item[i]);
+ }
+ }
+ content += row.join(',') + '\n';
+ });
+ return content;
+ },
+
+ /**
+ * Extracts filename from linux/unix path
+ * @param path
+ * @return {string}: filename
+ */
+ getFileFromPath: function(path) {
+ if (!path || typeof path !== 'string') {
+ return '';
+ }
+ return path.replace(/^.*[\/]/, '');
+ },
+
+ getPath: function(path) {
+ if (!path || typeof path !== 'string' || path[0] != '/') {
+ return '';
+ }
+ var last_slash = path.lastIndexOf('/');
+ return (last_slash!=0)?path.substr(0,last_slash):'/';
+ }
+};
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/templates/common/chart.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/templates/common/chart.hbs b/ambari-web/contrib/views/slider/src/main/resources/ui/app/templates/common/chart.hbs
new file mode 100644
index 0000000..1a7e393
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/templates/common/chart.hbs
@@ -0,0 +1,26 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div {{bind-attr class=":time-label"}}>{{view.parentView.currentTimeState.name}}</div>
+<div {{bind-attr id="view.containerId"}} {{bind-attr class="view.containerClass :chart-container"}}>
+ <div {{bind-attr id="view.yAxisId"}} {{bind-attr class="view.yAxisClass :chart-y-axis"}}></div>
+ <div {{bind-attr id="view.xAxisId"}} {{bind-attr class="view.xAxisClass :chart-x-axis"}}></div>
+ <div {{bind-attr id="view.legendId"}} {{bind-attr class="view.legendClass :chart-legend"}}></div>
+ <div {{bind-attr id="view.chartId"}} {{bind-attr class="view.chartClass :chart"}}></div>
+ <div {{bind-attr id="view.titleId"}} {{bind-attr class="view.titleClass :chart-title"}}>{{view.title}}</div>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js b/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js
new file mode 100644
index 0000000..4af203b
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/common/chart_view.js
@@ -0,0 +1,915 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+var string_utils = require('helpers/string_utils');
+
+/**
+ * @class
+ *
+ * This is a view which GETs data from a URL and shows it as a time based line
+ * graph. Time is shown on the X axis with data series shown on Y axis. It
+ * optionally also has the ability to auto refresh itself over a given time
+ * interval.
+ *
+ * This is an abstract class which is meant to be extended.
+ *
+ * Extending classes should override the following:
+ * <ul>
+ * <li>url - from where the data can be retrieved
+ * <li>title - Title to be displayed when showing the chart
+ * <li>id - which uniquely identifies this chart in any page
+ * <li>#transformToSeries(jsonData) - function to map server data into graph
+ * series
+ * </ul>
+ *
+ * Extending classes could optionally override the following:
+ * <ul>
+ * <li>#colorForSeries(series) - function to get custom colors per series
+ * </ul>
+ *
+ * @extends Ember.Object
+ * @extends Ember.View
+ */
+App.ChartView = Ember.View.extend({
+
+ templateName: 'common/chart',
+
+ /**
+ * The URL from which data can be retrieved.
+ *
+ * This property must be provided for the graph to show properly.
+ *
+ * @type String
+ * @default null
+ */
+ url: null,
+
+ /**
+ * A unique ID for this chart.
+ *
+ * @type String
+ * @default null
+ */
+ id: null,
+
+ /**
+ * Title to be shown under the chart.
+ *
+ * @type String
+ * @default null
+ */
+ title: null,
+
+ /**
+ * @private
+ *
+ * @type Rickshaw.Graph
+ * @default null
+ */
+ _graph: null,
+
+ /**
+ * Array of classnames for each series (in widget)
+ * @type Rickshaw.Graph
+ */
+ _popupGraph: null,
+
+ /**
+ * Array of classnames for each series
+ * @type Array
+ */
+ _seriesProperties: null,
+
+ /**
+ * Array of classnames for each series (in widget)
+ * @type Array
+ */
+ _seriesPropertiesWidget: null,
+
+ /**
+ * Renderer type
+ * See <code>Rickshaw.Graph.Renderer</code> for more info
+ * @type String
+ */
+ renderer: 'area',
+
+ /**
+ * Suffix used in DOM-elements selectors
+ * @type String
+ */
+ popupSuffix: '-popup',
+
+ /**
+ * Is popup for current graph open
+ * @type Boolean
+ */
+ isPopup: false,
+
+ /**
+ * Is graph ready
+ * @type Boolean
+ */
+ isReady: false,
+
+ /**
+ * Is popup-graph ready
+ * @type Boolean
+ */
+ isPopupReady: false,
+
+ /**
+ * Is data for graph available
+ * @type Boolean
+ */
+ hasData: true,
+
+ containerId: null,
+ containerClass: null,
+ yAxisId: null,
+ yAxisClass: null,
+ xAxisId: null,
+ xAxisClass: null,
+ legendId: null,
+ legendClass: null,
+ chartId: null,
+ chartClass: null,
+ titleId: null,
+ titleClass: null,
+
+ didInsertElement: function() {
+ var id = this.get('id');
+ var idTemplate = id + '-{element}';
+
+ this.set('containerId', idTemplate.replace('{element}', 'container'));
+ this.set('containerClass', 'chart-container');
+ this.set('yAxisId', idTemplate.replace('{element}', 'yaxis'));
+ this.set('yAxisClass', this.get('yAxisId'));
+ this.set('xAxisId', idTemplate.replace('{element}', 'xaxis'));
+ this.set('xAxisClass', this.get('xAxisId'));
+ this.set('legendId', idTemplate.replace('{element}', 'legend'));
+ this.set('legendClass', this.get('legendId'));
+ this.set('chartId', idTemplate.replace('{element}', 'chart'));
+ this.set('chartClass', this.get('chartId'));
+ this.set('titleId', idTemplate.replace('{element}', 'title'));
+ this.set('titleClass', this.get('titleId'));
+ this.loadData();
+ },
+
+
+ loadData: function() {
+ App.ajax.send({
+ name: this.get('ajaxIndex'),
+ sender: this,
+ data: this.getDataForAjaxRequest(),
+ success: '_refreshGraph',
+ error: 'loadDataErrorCallback'
+ });
+ },
+
+ getDataForAjaxRequest: function() {
+ return {};
+ },
+
+ loadDataErrorCallback: function(xhr, textStatus, errorThrown) {
+ this.set('isReady', true);
+ if (xhr.readyState == 4 && xhr.status) {
+ textStatus = xhr.status + " " + textStatus;
+ }
+ this._showMessage('warn', 'graphs.error.title', textStatus + ' ' + errorThrown);
+ this.set('isPopup', false);
+ this.set('hasData', false);
+ },
+
+ /**
+ * Shows a yellow warning message in place of the chart.
+ *
+ * @param type Can be any of 'warn', 'error', 'info', 'success'
+ * @param title Bolded title for the message
+ * @param message String representing the message
+ * @type: Function
+ */
+ _showMessage: function(type, title, message) {
+ var chartOverlay = '#' + this.id;
+ var chartOverlayId = chartOverlay + '-chart';
+ var chartOverlayY = chartOverlay + '-yaxis';
+ var chartOverlayX = chartOverlay + '-xaxis';
+ var chartOverlayLegend = chartOverlay + '-legend';
+ var chartOverlayTimeline = chartOverlay + '-timeline';
+ if (this.get('isPopup')) {
+ chartOverlayId += this.get('popupSuffix');
+ chartOverlayY += this.get('popupSuffix');
+ chartOverlayX += this.get('popupSuffix');
+ chartOverlayLegend += this.get('popupSuffix');
+ chartOverlayTimeline += this.get('popupSuffix');
+ }
+ var typeClass;
+ switch (type) {
+ case 'error':
+ typeClass = 'alert-error';
+ break;
+ case 'success':
+ typeClass = 'alert-success';
+ break;
+ case 'info':
+ typeClass = 'alert-info';
+ break;
+ default:
+ typeClass = '';
+ break;
+ }
+ $(chartOverlayId+', '+chartOverlayY+', '+chartOverlayX+', '+chartOverlayLegend+', '+chartOverlayTimeline).html('');
+ $(chartOverlayId).append('<div class=\"alert '+typeClass+'\"><strong>'+title+'</strong> '+message+'</div>');
+ },
+
+ /**
+ * Transforms the JSON data retrieved from the server into the series
+ * format that Rickshaw.Graph understands.
+ *
+ * The series object is generally in the following format: [ { name :
+ * "Series 1", data : [ { x : 0, y : 0 }, { x : 1, y : 1 } ] } ]
+ *
+ * Extending classes should override this method.
+ *
+ * @param seriesData
+ * Data retrieved from the server
+ * @param displayName
+ * Graph title
+ * @type: Function
+ *
+ */
+ transformData: function (seriesData, displayName) {
+ var seriesArray = [];
+ if (seriesData != null) {
+ // Is it a string?
+ if ("string" == typeof seriesData) {
+ seriesData = JSON.parse(seriesData);
+ }
+ // Is it a number?
+ if ("number" == typeof seriesData) {
+ // Same number applies to all time.
+ var number = seriesData;
+ seriesData = [];
+ seriesData.push([number, (new Date().getTime())-(60*60)]);
+ seriesData.push([number, (new Date().getTime())]);
+ }
+ // We have valid data
+ var series = {};
+ series.name = displayName;
+ series.data = [];
+ for ( var index = 0; index < seriesData.length; index++) {
+ series.data.push({
+ x: seriesData[index][1],
+ y: seriesData[index][0]
+ });
+ }
+ return series;
+ }
+ return null;
+ },
+
+ /**
+ * Provides the formatter to use in displaying Y axis.
+ *
+ * Uses the App.ChartLinearTimeView.DefaultFormatter which shows 10K,
+ * 300M etc.
+ *
+ * @type Function
+ */
+ yAxisFormatter: function(y) {
+ return App.ChartView.DefaultFormatter(y);
+ },
+
+ /**
+ * Provides the color (in any HTML color format) to use for a particular
+ * series.
+ * May be redefined in child views
+ *
+ * @param series
+ * Series for which color is being requested
+ * @return color String. Returning null allows this chart to pick a color
+ * from palette.
+ * @default null
+ * @type Function
+ */
+ colorForSeries: function (series) {
+ return null;
+ },
+
+ /**
+ * Check whether seriesData is correct data for chart drawing
+ * @param {Array} seriesData
+ * @return {Boolean}
+ */
+ checkSeries : function(seriesData) {
+ if(!seriesData || !seriesData.length) {
+ return false;
+ }
+ var result = true;
+ seriesData.forEach(function(item) {
+ if(!item.data || !item.data.length || !item.data[0] || typeof item.data[0].x === 'undefined') {
+ result = false;
+ }
+ });
+ return result;
+ },
+
+ /**
+ * @private
+ *
+ * Refreshes the graph with the latest JSON data.
+ *
+ * @type Function
+ */
+ _refreshGraph: function (jsonData) {
+ if(this.get('isDestroyed')){
+ return;
+ }
+ var seriesData = this.transformToSeries(jsonData);
+
+ //if graph opened as modal popup
+ var popup_path = $("#" + this.get('id') + "-container" + this.get('popupSuffix'));
+ var graph_container = $("#" + this.get('id') + "-container");
+ if(popup_path.length) {
+ popup_path.children().each(function () {
+ $(this).children().remove();
+ });
+ this.set('isPopup', true);
+ }
+ else {
+ graph_container.children().each(function (index, value) {
+ $(value).children().remove();
+ });
+ }
+ if (this.checkSeries(seriesData)) {
+ // Check container exists (may be not, if we go to another page and wait while graphs loading)
+ if (graph_container.length) {
+ this.draw(seriesData);
+ this.set('hasData', true);
+ //move yAxis value lower to make them fully visible
+ $("#" + this.id + "-container").find('.y_axis text').attr('y',8);
+ }
+ }
+ else {
+ this.set('isReady', true);
+ //if Axis X time interval is default(60 minutes)
+ if(this.get('timeUnitSeconds') === 3600){
+ this._showMessage('info', this.t('graphs.noData.title'), this.t('graphs.noData.message'));
+ this.set('hasData', false);
+ }
+ else {
+ this._showMessage('info', this.t('graphs.noData.title'), this.t('graphs.noDataAtTime.message'));
+ }
+ this.set('isPopup', false);
+ }
+ },
+
+ /**
+ * Returns a custom time unit, that depends on X axis interval length, for the graph's X axis.
+ * This is needed as Rickshaw's default time X axis uses UTC time, which can be confusing
+ * for users expecting locale specific time.
+ *
+ * If <code>null</code> is returned, Rickshaw's default time unit is used.
+ *
+ * @type Function
+ * @return Rickshaw.Fixtures.Time
+ */
+ localeTimeUnit: function(timeUnitSeconds) {
+ var timeUnit = new Rickshaw.Fixtures.Time();
+ switch (timeUnitSeconds){
+ case 604800:
+ timeUnit = timeUnit.unit('day');
+ break;
+ case 2592000:
+ timeUnit = timeUnit.unit('week');
+ break;
+ case 31104000:
+ timeUnit = timeUnit.unit('month');
+ break;
+ default:
+ timeUnit = {
+ name: timeUnitSeconds / 240 + ' minute',
+ seconds: timeUnitSeconds / 4,
+ formatter: function (d) {
+ return d.toLocaleString().match(/(\d+:\d+):/)[1];
+ }
+ };
+ }
+ return timeUnit;
+ },
+
+ /**
+ * temporary fix for incoming data for graph
+ * to shift data time to correct time point
+ * @param {Array} data
+ */
+ dataShiftFix: function(data) {
+ var nowTime = Math.round((new Date().getTime()) / 1000);
+ data.forEach(function(series){
+ var l = series.data.length;
+ var shiftDiff = nowTime - series.data[l - 1].x;
+ if(shiftDiff > 3600){
+ for(var i = 0;i < l;i++){
+ series.data[i].x = series.data[i].x + shiftDiff;
+ }
+ series.data.unshift({
+ x: nowTime - this.get('timeUnitSeconds'),
+ y: 0
+ });
+ }
+ }, this);
+ },
+
+ /**
+ * calculate statistic data for popup legend and set proper colors for series
+ * @param {Array} data
+ */
+ dataPreProcess: function(data) {
+ var self = this;
+ var palette = new Rickshaw.Color.Palette({ scheme: 'munin'});
+ // Format series for display
+ var series_min_length = 100000000;
+ data.forEach(function (series, index) {
+ var seriesColor = self.colorForSeries(series);
+ if (seriesColor == null) {
+ seriesColor = palette.color();
+ }
+ series.color = seriesColor;
+ series.stroke = 'rgba(0,0,0,0.3)';
+ if (this.get('isPopup')) {
+ // calculate statistic data for popup legend
+ var avg = 0;
+ var min = Number.MAX_VALUE;
+ var max = Number.MIN_VALUE;
+ for (var i = 0; i < series.data.length; i++) {
+ avg += series.data[i]['y'];
+ if (series.data[i]['y'] < min) {
+ min = series.data[i]['y'];
+ }
+ else {
+ if (series.data[i]['y'] > max) {
+ max = series.data[i]['y'];
+ }
+ }
+ }
+ series.name = string_utils.pad(series.name, 30, ' ', 2) +
+ string_utils.pad('min', 5, ' ', 3) +
+ string_utils.pad(this.get('yAxisFormatter')(min), 12, ' ', 3) +
+ string_utils.pad('avg', 5, ' ', 3) +
+ string_utils.pad(this.get('yAxisFormatter')(avg/series.data.length), 12, ' ', 3) +
+ string_utils.pad('max', 12, ' ', 3) +
+ string_utils.pad(this.get('yAxisFormatter')(max), 5, ' ', 3);
+ }
+ if (series.data.length < series_min_length) {
+ series_min_length = series.data.length;
+ }
+ }.bind(this));
+
+ // All series should have equal length
+ data.forEach(function(series, index) {
+ if (series.data.length > series_min_length) {
+ series.data.length = series_min_length;
+ }
+ });
+ },
+
+ draw: function(seriesData) {
+ var self = this;
+ var isPopup = this.get('isPopup');
+ var p = isPopup ? this.get('popupSuffix') : '';
+
+ this.dataShiftFix(seriesData);
+ this.dataPreProcess(seriesData);
+
+ var chartId = "#" + this.get('id') + "-chart" + p;
+ var chartOverlayId = "#" + this.get('id') + "-container" + p;
+ var xaxisElementId = "#" + this.get('id') + "-xaxis" + p;
+ var yaxisElementId = "#" + this.get('id') + "-yaxis" + p;
+ var legendElementId = "#" + this.get('id') + "-legend" + p;
+
+ var chartElement = document.querySelector(chartId);
+ var overlayElement = document.querySelector(chartOverlayId);
+ var xaxisElement = document.querySelector(xaxisElementId);
+ var yaxisElement = document.querySelector(yaxisElementId);
+ var legendElement = document.querySelector(legendElementId);
+
+ var height = 150;
+ var width = 400;
+ var diff = 32;
+
+ if(this.get('inWidget')) {
+ height = 105; // for widgets view
+ diff = 22;
+ }
+ if (isPopup) {
+ height = 180;
+ width = 670;
+ }
+ else {
+ // If not in popup, the width could vary.
+ // We determine width based on div's size.
+ var thisElement = this.get('element');
+ if (thisElement!=null) {
+ var calculatedWidth = $(thisElement).width();
+ if (calculatedWidth > diff) {
+ width = calculatedWidth - diff;
+ }
+ }
+ }
+
+ var _graph = new Rickshaw.Graph({
+ height: height,
+ width: width,
+ element: chartElement,
+ series: seriesData,
+ interpolation: 'step-after',
+ stroke: true,
+ renderer: this.get('renderer'),
+ strokeWidth: (this.get('renderer') != 'area' ? 2 : 1)
+ });
+
+ if (this.get('renderer') === 'area') {
+ _graph.renderer.unstack = false;
+ }
+
+ new Rickshaw.Graph.Axis.Time({
+ graph: _graph,
+ timeUnit: this.localeTimeUnit(this.get('timeUnitSeconds'))
+ });
+
+ new Rickshaw.Graph.Axis.Y({
+ tickFormat: this.yAxisFormatter,
+ element: yaxisElement,
+ orientation: (isPopup ? 'left' : 'right'),
+ graph: _graph
+ });
+
+ var legend = new Rickshaw.Graph.Legend({
+ graph: _graph,
+ element: legendElement
+ });
+
+ new Rickshaw.Graph.Behavior.Series.Toggle({
+ graph: _graph,
+ legend: legend
+ });
+
+ new Rickshaw.Graph.Behavior.Series.Order({
+ graph: _graph,
+ legend: legend
+ });
+
+ if (!isPopup) {
+ overlayElement.addEventListener('mousemove', function () {
+ $(xaxisElement).removeClass('hide');
+ $(legendElement).removeClass('hide');
+ $(chartElement).children("div").removeClass('hide');
+ });
+ overlayElement.addEventListener('mouseout', function () {
+ $(legendElement).addClass('hide');
+ });
+ _graph.onUpdate(function () {
+ $(legendElement).addClass('hide');
+ });
+ }
+
+ //show the graph when it's loaded
+ _graph.onUpdate(function() {
+ self.set('isReady', true);
+ });
+ _graph.render();
+
+ if (isPopup) {
+ new Rickshaw.Graph.HoverDetail({
+ graph: _graph,
+ yFormatter:function (y) {
+ return self.yAxisFormatter(y);
+ },
+ xFormatter:function (x) {
+ return (new Date(x * 1000)).toLocaleTimeString();
+ },
+ formatter:function (series, x, y, formattedX, formattedY, d) {
+ return formattedY + '<br />' + formattedX;
+ }
+ });
+ }
+
+ _graph = this.updateSeriesInGraph(_graph);
+ if (isPopup) {
+ //show the graph when it's loaded
+ _graph.onUpdate(function() {
+ self.set('isPopupReady', true);
+ });
+ _graph.update();
+
+ var selector = '#'+this.get('id')+'-container'+this.get('popupSuffix');
+ $(selector + ' li.line').click(function() {
+ var series = [];
+ $(selector + ' a.action').each(function(index, v) {
+ series[index] = v.parentNode.classList;
+ });
+ self.set('_seriesProperties', series);
+ });
+
+ this.set('_popupGraph', _graph);
+ }
+ else {
+ _graph.update();
+ var selector = '#'+this.get('id')+'-container';
+ $(selector + ' li.line').click(function() {
+ var series = [];
+ $(selector + ' a.action').each(function(index, v) {
+ series[index] = v.parentNode.classList;
+ });
+ self.set('_seriesPropertiesWidget', series);
+ });
+
+ this.set('_graph', _graph);
+ }
+ },
+
+ /**
+ *
+ * @param {Rickshaw.Graph} graph
+ * @returns {Rickshaw.Graph}
+ */
+ updateSeriesInGraph: function(graph) {
+ var id = this.get('id');
+ var isPopup = this.get('isPopup');
+ var popupSuffix = this.get('popupSuffix');
+ var _series = isPopup ? this.get('_seriesProperties') : this.get('_seriesPropertiesWidget');
+ graph.series.forEach(function(series, index) {
+ if (_series !== null && _series[index] !== null && _series[index] !== undefined ) {
+ if(_series[_series.length - index - 1].length > 1) {
+ var s = '#' + id + '-container' + (isPopup ? popupSuffix : '') + ' a.action:eq(' + (_series.length - index - 1) + ')';
+ $(s).parent('li').addClass('disabled');
+ series.disable();
+ }
+ }
+ });
+ return graph;
+ },
+
+ showGraphInPopup: function() {
+ if(!this.get('hasData')) {
+ return;
+ }
+
+ this.set('isPopup', true);
+ var self = this;
+
+ App.ModalPopup.show({
+ bodyClass: Em.View.extend({
+
+ containerId: null,
+ containerClass: null,
+ yAxisId: null,
+ yAxisClass: null,
+ xAxisId: null,
+ xAxisClass: null,
+ legendId: null,
+ legendClass: null,
+ chartId: null,
+ chartClass: null,
+ titleId: null,
+ titleClass: null,
+
+ isReady: function() {
+ return this.get('parentView.graph.isPopupReady');
+ }.property('parentView.graph.isPopupReady'),
+
+ didInsertElement: function() {
+ $('#modal').addClass('modal-graph-line');
+ var popupSuffix = this.get('parentView.graph.popupSuffix');
+ var id = this.get('parentView.graph.id');
+ var idTemplate = id + '-{element}' + popupSuffix;
+
+ this.set('containerId', idTemplate.replace('{element}', 'container'));
+ this.set('containerClass', 'chart-container' + popupSuffix);
+ this.set('yAxisId', idTemplate.replace('{element}', 'yaxis'));
+ this.set('yAxisClass', this.get('yAxisId').replace(popupSuffix, ''));
+ this.set('xAxisId', idTemplate.replace('{element}', 'xaxis'));
+ this.set('xAxisClass', this.get('xAxisId').replace(popupSuffix, ''));
+ this.set('legendId', idTemplate.replace('{element}', 'legend'));
+ this.set('legendClass', this.get('legendId').replace(popupSuffix, ''));
+ this.set('chartId', idTemplate.replace('{element}', 'chart'));
+ this.set('chartClass', this.get('chartId').replace(popupSuffix, ''));
+ this.set('titleId', idTemplate.replace('{element}', 'title'));
+ this.set('titleClass', this.get('titleId').replace(popupSuffix, ''));
+ },
+
+ templateName: require('templates/common/chart/linear_time'),
+ /**
+ * check is time paging feature is enable for graph
+ */
+ isTimePagingEnable: function() {
+ return !self.get('isTimePagingDisable');
+ }.property(),
+ rightArrowVisible: function() {
+ return (this.get('isReady') && (this.get('parentView.currentTimeIndex') != 0));
+ }.property('isReady', 'parentView.currentTimeIndex'),
+ leftArrowVisible: function() {
+ return (this.get('isReady') && (this.get('parentView.currentTimeIndex') != 7));
+ }.property('isReady', 'parentView.currentTimeIndex')
+ }),
+ header: this.get('title'),
+ /**
+ * App.ChartLinearTimeView
+ */
+ graph: self,
+ secondary: null,
+ onPrimary: function() {
+ this.hide();
+ self.set('isPopup', false);
+ self.set('timeUnitSeconds', 3600);
+ },
+ onClose: function() {
+ this.onPrimary();
+ },
+ /**
+ * move graph back by time
+ * @param event
+ */
+ switchTimeBack: function(event) {
+ var index = this.get('currentTimeIndex');
+ // 7 - number of last time state
+ if(index < 7) {
+ this.reloadGraphByTime(++index);
+ }
+ },
+ /**
+ * move graph forward by time
+ * @param event
+ */
+ switchTimeForward: function(event) {
+ var index = this.get('currentTimeIndex');
+ if(index > 0) {
+ this.reloadGraphByTime(--index);
+ }
+ },
+ /**
+ * reload graph depending on the time
+ * @param index
+ */
+ reloadGraphByTime: function(index) {
+ this.set('currentTimeIndex', index);
+ self.set('timeUnitSeconds', this.get('timeStates')[index].seconds);
+ self.loadData();
+ },
+ timeStates: [
+ {name: Em.I18n.t('graphs.timeRange.hour'), seconds: 3600},
+ {name: Em.I18n.t('graphs.timeRange.twoHours'), seconds: 7200},
+ {name: Em.I18n.t('graphs.timeRange.fourHours'), seconds: 14400},
+ {name: Em.I18n.t('graphs.timeRange.twelveHours'), seconds: 43200},
+ {name: Em.I18n.t('graphs.timeRange.day'), seconds: 86400},
+ {name: Em.I18n.t('graphs.timeRange.week'), seconds: 604800},
+ {name: Em.I18n.t('graphs.timeRange.month'), seconds: 2592000},
+ {name: Em.I18n.t('graphs.timeRange.year'), seconds: 31104000}
+ ],
+ currentTimeIndex: 0,
+ currentTimeState: function() {
+ return this.get('timeStates').objectAt(this.get('currentTimeIndex'));
+ }.property('currentTimeIndex')
+ });
+ Ember.run.next(function() {
+ self.loadData();
+ self.set('isPopupReady', false);
+ });
+ },
+ //60 minute interval on X axis.
+ timeUnitSeconds: 3600
+});
+
+/**
+ * A formatter which will turn a number into computer storage sizes of the
+ * format '23 GB' etc.
+ *
+ * @type {Function}
+ */
+App.ChartView.BytesFormatter = function (y) {
+ if (y == 0) return '0 B';
+ var value = Rickshaw.Fixtures.Number.formatBase1024KMGTP(y);
+ if (!y || y.length < 1) {
+ value = '0 B';
+ }
+ else {
+ if ("number" == typeof value) {
+ value = String(value);
+ }
+ if ("string" == typeof value) {
+ value = value.replace(/\.\d(\d+)/, function($0, $1){ // Remove only 1-digit after decimal part
+ return $0.replace($1, '');
+ });
+ // Either it ends with digit or ends with character
+ value = value.replace(/(\d$)/, '$1 '); // Ends with digit like '120'
+ value = value.replace(/([a-zA-Z]$)/, ' $1'); // Ends with character like
+ // '120M'
+ value = value + 'B'; // Append B to make B, MB, GB etc.
+ }
+ }
+ return value;
+};
+
+/**
+ * A formatter which will turn a number into percentage display like '42%'
+ *
+ * @type {Function}
+ */
+App.ChartView.PercentageFormatter = function (percentage) {
+ var value = percentage;
+ if (!value || value.length < 1) {
+ value = '0 %';
+ } else {
+ value = value.toFixed(3).replace(/0+$/, '').replace(/\.$/, '') + '%';
+ }
+ return value;
+};
+
+/**
+ * A formatter which will turn elapsed time into display time like '50 ms',
+ * '5s', '10 m', '3 hr' etc. Time is expected to be provided in milliseconds.
+ *
+ * @type {Function}
+ */
+App.ChartView.TimeElapsedFormatter = function (millis) {
+ var value = millis;
+ if (!value || value.length < 1) {
+ value = '0 ms';
+ } else if ("number" == typeof millis) {
+ var seconds = millis > 1000 ? Math.round(millis / 1000) : 0;
+ var minutes = seconds > 60 ? Math.round(seconds / 60) : 0;
+ var hours = minutes > 60 ? Math.round(minutes / 60) : 0;
+ var days = hours > 24 ? Math.round(hours / 24) : 0;
+ if (days > 0) {
+ value = days + ' d';
+ } else if (hours > 0) {
+ value = hours + ' hr';
+ } else if (minutes > 0) {
+ value = minutes + ' m';
+ } else if (seconds > 0) {
+ value = seconds + ' s';
+ } else if (millis > 0) {
+ value = millis.toFixed(3).replace(/0+$/, '').replace(/\.$/, '') + ' ms';
+ } else {
+ value = millis.toFixed(3).replace(/0+$/, '').replace(/\.$/, '') + ' ms';
+ }
+ }
+ return value;
+};
+
+/**
+ * The default formatter which uses Rickshaw.Fixtures.Number.formatKMBT
+ * which shows 10K, 300M etc.
+ *
+ * @type {Function}
+ */
+App.ChartView.DefaultFormatter = function(y) {
+ if(isNaN(y)){
+ return 0;
+ }
+ var value = Rickshaw.Fixtures.Number.formatKMBT(y);
+ if (value == '') return '0';
+ value = String(value);
+ var c = value[value.length - 1];
+ if (!isNaN(parseInt(c))) {
+ // c is digit
+ value = parseFloat(value).toFixed(3).replace(/0+$/, '').replace(/\.$/, '');
+ }
+ else {
+ // c in not digit
+ value = parseFloat(value.substr(0, value.length - 1)).toFixed(3).replace(/0+$/, '').replace(/\.$/, '') + c;
+ }
+ return value;
+};
+
+
+/**
+ * Creates and returns a formatter that can convert a 'value'
+ * to 'value units/s'.
+ *
+ * @param unitsPrefix Prefix which will be used in 'unitsPrefix/s'
+ * @param valueFormatter Value itself will need further processing
+ * via provided formatter. Ex: '10M requests/s'. Generally
+ * should be App.ChartLinearTimeView.DefaultFormatter.
+ * @return {Function}
+ */
+App.ChartView.CreateRateFormatter = function (unitsPrefix, valueFormatter) {
+ var suffix = " "+unitsPrefix+"/s";
+ return function (value) {
+ value = valueFormatter(value) + suffix;
+ return value;
+ };
+};
http://git-wip-us.apache.org/repos/asf/ambari/blob/79f3a1a3/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/metric2_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/metric2_view.js b/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/metric2_view.js
new file mode 100644
index 0000000..2838888
--- /dev/null
+++ b/ambari-web/contrib/views/slider/src/main/resources/ui/app/views/slider_app/metrics/metric2_view.js
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+/**
+ * @class
+ *
+ * This is a view for showing cluster CPU metrics
+ *
+ * @extends App.ChartView
+ * @extends Ember.Object
+ * @extends Ember.View
+ */
+App.Metric2View = App.ChartView.extend({
+ id: "service-metrics-hdfs-jvm-threads",
+ title: 'jvm Threads',
+ renderer: 'line',
+
+ ajaxIndex: 'metrics2',
+
+ transformToSeries: function (jsonData) {
+ var seriesArray = [];
+ if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
+ for ( var name in jsonData.metrics.jvm) {
+ var displayName;
+ var seriesData = jsonData.metrics.jvm[name];
+ switch (name) {
+ case "threadsBlocked":
+ displayName = 'Threads Blocked';
+ break;
+ case "threadsWaiting":
+ displayName = 'Threads Waiting';
+ break;
+ case "threadsTimedWaiting":
+ displayName = 'Threads Timed Waiting';
+ break;
+ case "threadsRunnable":
+ displayName = 'Threads Runnable';
+ break;
+ default:
+ break;
+ }
+ if (seriesData) {
+ seriesArray.push(this.transformData(seriesData, displayName));
+ }
+ }
+ }
+ return seriesArray;
+ }
+});