Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Health statistics #384

Open
wants to merge 128 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
9d3df24
adding Health Statistics.jag
ashandk Jul 4, 2015
71b9586
Health Statistics Render
ashandk Jul 4, 2015
bfc7b46
Health Statistics Partial class
ashandk Jul 4, 2015
fdbef49
Health Statistics Charts
ashandk Jul 4, 2015
e51db92
Health Statistics OutPut Adapter and Event Formatter without Flight R…
ashandk Jul 7, 2015
bb090ee
Update OutPutadaptorRDBMStoPublishHealthStat.xml
ashandk Jul 8, 2015
7484b0b
Update Average_Member_Load_Average.xml
ashandk Jul 8, 2015
3643b5f
Event Formatter Flight Request And Data Source
ashandk Jul 8, 2015
f57c5b2
Merge branch 'HealthStatistics' of https://github.com/ashandk/stratos…
ashandk Jul 8, 2015
3921c52
Data Source
ashandk Jul 8, 2015
c4064a3
Data Source Changes
ashandk Jul 8, 2015
ef16940
Data Source Changes
ashandk Jul 8, 2015
5ca895e
ReadMe File to deploy cep artifacts
ashandk Jul 8, 2015
e0bb022
Health Spealling Correction
ashandk Jul 8, 2015
4c65e70
Adding the Time Stamp to the Cartridge Agent Payload
ashandk Jul 8, 2015
e09334c
Adding the Time Stamp to the In FLight Request Payload
ashandk Jul 9, 2015
225952e
Updating Read Me
ashandk Jul 9, 2015
3c3fc11
Flight Request Count Formatter
ashandk Jul 9, 2015
431710d
Changing SQL Column Assembly
ashandk Jul 9, 2015
9c0fce9
Sending Member Load Average data to the RDBMS with TimeStamp
ashandk Jul 9, 2015
efa25eb
Sending Member Memory Consumption data to the RDBMS with TimeStamp
ashandk Jul 9, 2015
d168c16
Adding the licenses Header
ashandk Jul 9, 2015
d4115ed
Health Statistics DataSource and its Assembly
ashandk Jul 9, 2015
b1a40e8
changing local passwords
ashandk Jul 9, 2015
a6a7c46
changing database coloumns and removed datasource
ashandk Jul 10, 2015
78270c1
Java Beans for the REST API
ashandk Jul 11, 2015
3933aeb
REST Bean to get Average Memory Conumption
ashandk Jul 11, 2015
6e20979
Delete InFlightRequest.java
ashandk Jul 11, 2015
454a4d6
Delete AverageMemberMemory.java
ashandk Jul 11, 2015
6b4c22f
Delete MemberLoadAverage.java
ashandk Jul 11, 2015
c54c26d
REST Bean to get Average Memory Conumption
ashandk Jul 11, 2015
cd2f3b8
Merge branch 'HealthStatistics' of https://github.com/ashandk/stratos…
ashandk Jul 11, 2015
0f71e5e
REST Bean to get Average Memory Conumption
ashandk Jul 11, 2015
60bf515
REST Bean to get Average Load Average
ashandk Jul 11, 2015
5b2ce68
REST Bean to get In Flight Request
ashandk Jul 11, 2015
57efe03
DataBase Connection for HealthStat
ashandk Jul 11, 2015
24ab63f
REST API Imlementation
ashandk Jul 11, 2015
c0b43ea
REST API Changes
ashandk Jul 11, 2015
4b01bd8
Changes
ashandk Jul 13, 2015
5ab9159
Commiting the REST API for Health Statistics UI
ashandk Jul 13, 2015
7112c1a
Implement Changes
ashandk Jul 14, 2015
f32dbea
Event Publishing Changes
ashandk Jul 14, 2015
45e8c16
Adding Changes accoding to the CODE review.Changing REST urls on sugg…
ashandk Jul 14, 2015
3888ceb
Commiting Java docs on methods which i have implemented for the REST …
ashandk Jul 15, 2015
3702641
Commiting REST call methods to the REST API from jaggery, to get data…
ashandk Jul 15, 2015
85c06f4
Adding UI changes on healthStatistic.hbs
ashandk Jul 15, 2015
4449459
Updating the REST API method responses.
ashandk Jul 17, 2015
380c28e
Validating REST API calls for null result sets.
ashandk Jul 18, 2015
3fb9369
Adding Health Statistics jag modifications with body on load data for…
ashandk Jul 18, 2015
9effd90
d3js chart tip libarary which use to give tool tips on charts.
ashandk Jul 18, 2015
e001cfc
Attaching the Health Statistics REST API calls controller. This class…
ashandk Jul 19, 2015
deaae58
RDBMS connection close method
ashandk Jul 19, 2015
5d924a4
implemented close connection for every method which use connection ha…
ashandk Jul 21, 2015
7616726
Validating the REST api response for null values in the UI side
ashandk Jul 21, 2015
310ea34
This are the UI components. rest calls to the REST api.health statist…
ashandk Jul 22, 2015
5d85797
Health Stat Publisher event formatter.This is to send all health stat…
ashandk Jul 26, 2015
70a0e13
Adding flight count data to a new export stream definition to create …
ashandk Jul 26, 2015
89f12ac
Chaning Health Stat topic.
ashandk Jul 26, 2015
cdd7534
Adding the new stream definition which create a new export stream tha…
ashandk Jul 26, 2015
d6e134e
Adding few minor changes to the UI
ashandk Jul 27, 2015
e7f7379
css style sheets for the health statistics UI
ashandk Jul 27, 2015
598318e
Adding the helper js file for the health statistics UI
ashandk Jul 27, 2015
80e6214
Commiting the tip js library
ashandk Jul 27, 2015
3be909f
application topology button changes
ashandk Jul 27, 2015
9782be5
Health statistics event formatter changing the output table assembly
ashandk Jul 27, 2015
60a2232
cluster variable -> Cluster
ashandk Jul 27, 2015
2b3de72
Connection handler class modification
ashandk Jul 27, 2015
7269f4f
Changed the back button location and the headline margins.
ashandk Jul 28, 2015
eea5d39
Changing the partials and removing all the scripts and style sheets f…
ashandk Jul 28, 2015
1490310
New health statistic js which include the javasripts for charts.
ashandk Jul 28, 2015
3e3cc07
Adding averages/flight counts in to the New output stream definiton w…
ashandk Jul 28, 2015
e39d118
removing unused variables.
ashandk Jul 29, 2015
064b4b3
REST api changes code improvements.
ashandk Jul 29, 2015
cabb1d0
application topology changes.
ashandk Jul 29, 2015
36b2308
Fixed the bug in the button when onclick the colour doesn't change pr…
ashandk Jul 30, 2015
09da05a
comments for the charts implementation.
ashandk Jul 31, 2015
145bc25
Commiting the Ui changes
ashandk Jul 31, 2015
55b1a91
Commiting the changes of rest_call jag
ashandk Jul 31, 2015
2968805
Bug in the UI fixed.
ashandk Jul 31, 2015
db5e234
Enabling the left menu in the health statistics page.
ashandk Jul 31, 2015
8c7f487
adding margin to the back button.
ashandk Jul 31, 2015
d6f2831
Commiting a new button to the Show Health Statistic in topology view …
ashandk Aug 1, 2015
9886b3d
Changing button name to the Member/Cluster Health Statistic in topolo…
ashandk Aug 1, 2015
8389da4
Commiting the REST API changes which is reviewd by Lahirus. Id to Clu…
ashandk Aug 1, 2015
764e35c
mysql table clearing method implementation.
ashandk Aug 2, 2015
71e5436
Commenting on the healthStatistic jag implementation
ashandk Aug 2, 2015
e8b30c2
Commiting the REST jaggery method changes.
ashandk Aug 3, 2015
b5d396c
d3 tool tip enabling library.
ashandk Aug 3, 2015
9bd6304
Removing table data deletion method.
ashandk Aug 4, 2015
4054b29
adding export stream to AverageHeathRequest excution plan.
ashandk Aug 4, 2015
2db724f
Commiting the changes of configuaration document for CEP adapters.
ashandk Aug 4, 2015
0b84314
REST API changes in StratosApiV41.java to enable quering using Start_…
ashandk Aug 5, 2015
beea127
Commiting the implementation for search health statistics data by giv…
ashandk Aug 5, 2015
4ad2c7a
Changing UI for the new REST API.
ashandk Aug 5, 2015
ef4cd28
Changing UI REST call methods to the new REST Api.
ashandk Aug 5, 2015
0566bf5
UI changes on the new REST API methods.
ashandk Aug 5, 2015
cdec6f4
health statistic get request methods will call the trigger the rest_c…
ashandk Aug 6, 2015
8517d37
Configuration part for enabling and disabling the health statistic UI.
ashandk Aug 7, 2015
723b78f
Adding the enabling UI feature configuration property to the jag file.
ashandk Aug 7, 2015
d30b81d
Commiting the new UI changes for charts against the REST API
ashandk Aug 7, 2015
3642c35
Configuration to enable disable health stat UI. This will implement s…
ashandk Aug 8, 2015
ff4f633
Adding Div button to the HBS file
ashandk Aug 8, 2015
83084d3
adding the java script to check the configuration and add button if t…
ashandk Aug 8, 2015
072ca30
Git improving the code using the sonar cube.
ashandk Aug 9, 2015
6fa845a
Removing auto assemling healthstat-datasources.xml datasource. Lettin…
ashandk Aug 9, 2015
9798eee
Removing auto assembling the health statistic datasource.
ashandk Aug 9, 2015
67a1f82
Commiting the sonarqube optimization for the implemented code of the …
ashandk Aug 10, 2015
711e688
sonarqube optimization for the current implementation
ashandk Aug 10, 2015
4a258dc
Adding new Jaggery rest call triggers in UI back end.
ashandk Aug 11, 2015
1b7a77e
Git adding the application topology comments.
ashandk Aug 11, 2015
212a22b
Adding new css classes to the UI for the comments recieved from Daksh…
ashandk Aug 11, 2015
f75bc4c
Git REST api request changes UI backend
ashandk Aug 11, 2015
4216ddd
New UI css fields.
ashandk Aug 11, 2015
2c1a677
Adding the new charts with tool tip
ashandk Aug 12, 2015
a1f9b30
Adding the health statistics renders/partials.
ashandk Aug 12, 2015
0b87a40
Removing the formatter that are unneccesory.
ashandk Aug 12, 2015
d194c2a
UI changes to submit genaralizing the implementation.
ashandk Aug 13, 2015
6207834
Java Script code review changes.
ashandk Aug 14, 2015
626216d
Chaning the health statistics page URL
ashandk Aug 17, 2015
7fa751e
Changing method names and adding comments.
ashandk Aug 17, 2015
8c0264f
Adding class level comments.
ashandk Aug 18, 2015
82753c1
Formatted the code.
ashandk Aug 18, 2015
d6cf9d0
including SQL Exception object in the RestAPIException.
ashandk Aug 18, 2015
c0dd060
Formatted the Code.
ashandk Aug 18, 2015
65d770f
Removing unnecessary spaces.
ashandk Aug 18, 2015
cdf22cd
Reformatting the Code.
ashandk Aug 18, 2015
d5558cf
commiting changes for health stat charts.
ashandk Aug 19, 2015
fd28523
Changed and improved the implementation after getting the code review…
ashandk Aug 20, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* 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.
*/

package org.apache.stratos.common.beans.healthStatistics;

/*
* This bean class may use to create the data transfer objects for Load Average data of clusters and members.
* */
public class AverageLoadAverageBean {

private static final long serialVersionUID = -7788619177798333712L;

private final String clusterId;
private final Long timeStamp;
private final Double memberAverageLoadAverage;
private final String memberId;

public AverageLoadAverageBean(String clusterId, Long timeStamp, Double memberAverageLoadAverage, String memberId) {
this.clusterId = clusterId;
this.timeStamp = timeStamp;
this.memberAverageLoadAverage = memberAverageLoadAverage;
this.memberId = memberId;
}

public String getClusterId() {
return clusterId;
}

public Double getMemberAverageLoadAverage() {
return memberAverageLoadAverage;
}

public Long getTimeStamp() {
return timeStamp;
}

public String getMemberId() {
return memberId;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.
*/

package org.apache.stratos.common.beans.healthStatistics;

/*
* This bean class may use to create the data transfer objects for Average Memory data of clusters and members.
* */
public class AverageMemoryConsumptionBean {

private static final long serialVersionUID = -7788619177798333711L;

private final String clusterId;
private final Double memberAverageMemoryConsumption;
private final Long timeStamp;
private final String memberId;

public AverageMemoryConsumptionBean(final String clusterId,final Double memberAverageMemoryConsumption,final Long timeStamp,final String memberId) {
this.clusterId = clusterId;
this.memberAverageMemoryConsumption = memberAverageMemoryConsumption;
this.timeStamp = timeStamp;
this.memberId = memberId;
}

public String getClusterId() {
return clusterId;
}

public Double getMemberAverageMemoryConsumption() {
return memberAverageMemoryConsumption;
}

public Long getTimeStamp() {
return timeStamp;
}

public String getMemberId() {
return memberId;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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.
*/

package org.apache.stratos.common.beans.healthStatistics;

/*
* This bean class may use to create the data transfer objects for Inflight request data of clusters.
* */
public class InFlightRequestBean {

private static final long serialVersionUID = -7788619177798333712L;

private final String clusterId;
private final Long timeStamp;
private final Double inFlightRequestCount;

public InFlightRequestBean(String clusterId, Long timeStamp, Double inFlightRequestCount) {
this.clusterId = clusterId;
this.timeStamp = timeStamp;
this.inFlightRequestCount = inFlightRequestCount;
}

public String getClusterId() {
return clusterId;
}

public Double getInFlightRequestCount() {
return inFlightRequestCount;
}

public Long getTimeStamp() {
return timeStamp;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private static StreamDefinition createStreamDefinition() {
payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING));
payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
payloadData.add(new Attribute("member_id", AttributeType.STRING));
payloadData.add(new Attribute("timeStamp", AttributeType.LONG));
payloadData.add(new Attribute("partition_id", AttributeType.STRING));
payloadData.add(new Attribute("health_description", AttributeType.STRING));
payloadData.add(new Attribute("value", AttributeType.DOUBLE));
Expand Down Expand Up @@ -90,6 +91,7 @@ public void publish(String clusterId, String clusterInstanceId, String networkPa
payload.add(clusterInstanceId);
payload.add(networkPartitionId);
payload.add(memberId);
payload.add(System.currentTimeMillis());
payload.add(partitionId);
payload.add(health);
payload.add(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private static StreamDefinition createStreamDefinition() {
// Set payload definition
payloadData.add(new Attribute("cluster_id", AttributeType.STRING));
payloadData.add(new Attribute("cluster_instance_id", AttributeType.STRING));
payloadData.add(new Attribute("timeStamp", AttributeType.LONG));
payloadData.add(new Attribute("network_partition_id", AttributeType.STRING));
payloadData.add(new Attribute("in_flight_request_count", AttributeType.DOUBLE));
streamDefinition.setPayloadData(payloadData);
Expand All @@ -76,6 +77,7 @@ public void publish(String clusterId, String clusterInstanceId, String networkPa
List<Object> payload = new ArrayList<Object>();
payload.add(clusterId);
payload.add(clusterInstanceId);
payload.add(System.currentTimeMillis());
payload.add(networkPartitionId);
payload.add((double) inFlightRequestCount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var log = new Log("apachestratos.applications_form"),
error = [],
list_data,
caramel = require('caramel'),
config = require('/config/console.json'),
context = caramel.configs().context,
menuJson = require('/controllers/menu/menu.json'),
util = require('/controllers/rest/rest_calls.jag'),
Expand All @@ -49,7 +50,8 @@ if (!elements) {
var applicationName = elements.applicationId;

//get application json
applicationJSON = util.RESTCalls.getApplicationJSON(applicationName);
applicationJSONapplicationJSON = util.RESTCalls.getApplicationJSON(applicationName);

var applicationAlias = applicationJSON.alias;

if(elements.action == 'view'){
Expand Down Expand Up @@ -90,6 +92,7 @@ if (!elements) {

}

var healthStatisticEnable=config.healthStatistics.UI_enable;

var formtype = elements.formtype;

Expand All @@ -109,6 +112,7 @@ switch (formtype) {
var caramelData = {
breadcrumbPathLevelOne: breadcrumbPathLevelOne,
breadcrumbPathLevelTwo: '',
healthStatisticEnable:healthStatisticEnable,
left_menu: leftMenu,
isForm: isForm,
isEdit: isEdit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"backendServerConfiguration": {
"url": "%https.host%/api/v4.1"
},
"healthStatistics": {
"UI_enable": "false"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<%
/*
*
* 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 log = new Log("apachestratos.configure_request"),
util = require('/controllers/rest/rest_calls.jag'),
formtype = request.getParameter('formtype'),
ChartType = request.getParameter('chartType'),
Duration = request.getParameter('duration'),
IdValue = request.getParameter('idValue');

var formSubmit;
var DurationVal;

//creatingTimeObjects
var startTime = new Date();
var endTime = new Date();

//add login validator for pages
include('/controllers/login/validator.jag');

//checking the interval for the required data to check
if( "30Min" != Duration){

switch (Duration) {

case "1Hour":
DurationVal = 1;
break;
case "1Day":
DurationVal = 24;
break;
case "1Week":
DurationVal = 168;
break;
case "1Month":
DurationVal = 672;
break;
}

//substratcting hour from current time
startTime.setHours(endTime.getHours() - DurationVal);

} else {

//substratcting hour from current time
startTime.setMinutes(endTime.getMinutes() - 30);

}

//switch to trigger the rest call when needs
try {
switch (formtype) {

case "MemoryConsumption":

if("Cluster" == ChartType){

formSubmit = util.RESTCalls.getClusterMemoryAverageDetails(IdValue, startTime.getTime(),endTime.getTime());
break;
}
else{
formSubmit = util.RESTCalls.getMemberMemoryAvrageDetails(IdValue, startTime.getTime(),endTime.getTime());
break;
}

case "LoadAverage":

if("Cluster" == ChartType){
formSubmit = util.RESTCalls.getClusterLoadAverageDetails(IdValue, startTime.getTime(),endTime.getTime());
break;
}
else{
formSubmit = util.RESTCalls.getMemberLoadAverageDetails(IdValue, startTime.getTime(),endTime.getTime());
break;
}

case "InFlight":
formSubmit = util.RESTCalls.getFlightRequestDetails(IdValue, startTime.getTime(),endTime.getTime());
break;

default:
session.put("deploy-status", { "message": "Sorry Endpoint Error", "status": "error" });
}

//vaidating the response and return
if (formSubmit == undefined)
{
print({"status": 'error', "message": "No Data found!"});

} else {
print(formSubmit);
}

} catch (e) {
log.warn(e);
print({"status": 'error', "message": e.toString()});
}

%>
Loading