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

Commit

Permalink
Merge branch 'master' into switch-to-webpack-2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/index.html
  • Loading branch information
spiermar committed Aug 23, 2018
2 parents 61f2af1 + 42c15a9 commit 4c3ab35
Show file tree
Hide file tree
Showing 17 changed files with 18,678 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,8 @@ node_js:
script:
- npm run test
- npm run build
after_script:
- ./scripts/pushToDockerhub.sh
services:
- docker
env:
Expand Down
File renamed without changes.
80 changes: 80 additions & 0 deletions src/app/components/datamodel/bccTcptopMetric.datamodel.factory.js
@@ -0,0 +1,80 @@
/**!
*
* Copyright 2018 Andreas Gerstmayr.
*
* Licensed 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.
*
*/

(function () {
'use strict';

/**
* @name BccTcptopMetricDataModel
* @desc
*/
function BccTcptopMetricDataModel(WidgetDataModel, MetricListService, DashboardService, TableDataModel) {
var DataModel = function () {
return this;
};

DataModel.prototype = Object.create(WidgetDataModel.prototype);

DataModel.prototype.init = function () {
WidgetDataModel.prototype.init.call(this);

this.name = this.dataModelOptions ? this.dataModelOptions.name : 'metric_' + DashboardService.getGuid();

function bytes_to_kb(x) {
return (x / 1024).toFixed();
}

this.tableDefinition = {
columns: [
{label: 'PID', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.pid')},
{label: 'COMM', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.comm')},
{label: 'LADDR', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.laddr')},
{label: 'LPORT', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.lport')},
{label: 'DADDR', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.daddr')},
{label: 'DPORT', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.dport')},
{label: 'RX_KB', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.rx'), format: bytes_to_kb},
{label: 'TX_KB', metric: MetricListService.getOrCreateMetric('bcc.proc.io.net.tcptop.tx'), format: bytes_to_kb}
],
isMultiMetricsTable: true
};

// create derived metric
this.metric = MetricListService.getOrCreateDerivedMetric(this.name, TableDataModel.derivedFunction.bind(null, this.tableDefinition));

this.updateScope(this.metric.data);
};

DataModel.prototype.destroy = function () {
// remove subscribers and delete derived metric
MetricListService.destroyDerivedMetric(this.name);

// remove subscribers and delete base metrics
for (var i = 0; i < this.tableDefinition.columns.length; i++) {
MetricListService.destroyMetric(this.tableDefinition.columns[i].metric.name);
}

WidgetDataModel.prototype.destroy.call(this);
};

return DataModel;
}

angular
.module('datamodel')
.factory('BccTcptopMetricDataModel', BccTcptopMetricDataModel);
})();
@@ -0,0 +1,64 @@
/**!
*
* Copyright (C) 2018 Marko Myllynen <myllynen@redhat.com>
*
* Licensed 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.
*
*/

(function () {
'use strict';

/**
* @name BccTracepointhitsMetricDataModel
* @desc
*/
function BccTracepointhitsMetricDataModel(WidgetDataModel, MetricListService, DashboardService) {
var DataModel = function () {
return this;
};

DataModel.prototype = Object.create(WidgetDataModel.prototype);

DataModel.prototype.init = function () {
WidgetDataModel.prototype.init.call(this);

this.name = this.dataModelOptions ? this.dataModelOptions.name : 'metric_' + DashboardService.getGuid();
this.tableDefinition = {
columns: [
{label: 'TRACEPOINT'},
{label: 'HITS', css_class: 'text-right'}
],
rowFn: function(instance, value) {
return [instance, value];
}
};

this.metric = MetricListService.getOrCreateMetric('bcc.tracepoint.hits');
this.updateScope(this.metric.data);
};

DataModel.prototype.destroy = function () {
// remove subscribers and delete base metrics
MetricListService.destroyMetric(this.metric.name);

WidgetDataModel.prototype.destroy.call(this);
};

return DataModel;
}

angular
.module('datamodel')
.factory('BccTracepointhitsMetricDataModel', BccTracepointhitsMetricDataModel);
})();
@@ -0,0 +1,64 @@
/**!
*
* Copyright (C) 2018 Marko Myllynen <myllynen@redhat.com>
*
* Licensed 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.
*
*/

(function () {
'use strict';

/**
* @name BccUSDThitsMetricDataModel
* @desc
*/
function BccUSDThitsMetricDataModel(WidgetDataModel, MetricListService, DashboardService) {
var DataModel = function () {
return this;
};

DataModel.prototype = Object.create(WidgetDataModel.prototype);

DataModel.prototype.init = function () {
WidgetDataModel.prototype.init.call(this);

this.name = this.dataModelOptions ? this.dataModelOptions.name : 'metric_' + DashboardService.getGuid();
this.tableDefinition = {
columns: [
{label: 'USDT'},
{label: 'HITS', css_class: 'text-right'}
],
rowFn: function(instance, value) {
return [instance, value];
}
};

this.metric = MetricListService.getOrCreateMetric('bcc.usdt.hits');
this.updateScope(this.metric.data);
};

DataModel.prototype.destroy = function () {
// remove subscribers and delete base metrics
MetricListService.destroyMetric(this.metric.name);

WidgetDataModel.prototype.destroy.call(this);
};

return DataModel;
}

angular
.module('datamodel')
.factory('BccUSDThitsMetricDataModel', BccUSDThitsMetricDataModel);
})();
@@ -0,0 +1,64 @@
/**!
*
* Copyright (C) 2018 Marko Myllynen <myllynen@redhat.com>
*
* Licensed 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.
*
*/

(function () {
'use strict';

/**
* @name BccUprobehitsMetricDataModel
* @desc
*/
function BccUprobehitsMetricDataModel(WidgetDataModel, MetricListService, DashboardService) {
var DataModel = function () {
return this;
};

DataModel.prototype = Object.create(WidgetDataModel.prototype);

DataModel.prototype.init = function () {
WidgetDataModel.prototype.init.call(this);

this.name = this.dataModelOptions ? this.dataModelOptions.name : 'metric_' + DashboardService.getGuid();
this.tableDefinition = {
columns: [
{label: 'UPROBE'},
{label: 'HITS', css_class: 'text-right'}
],
rowFn: function(instance, value) {
return [instance, value];
}
};

this.metric = MetricListService.getOrCreateMetric('bcc.uprobe.hits');
this.updateScope(this.metric.data);
};

DataModel.prototype.destroy = function () {
// remove subscribers and delete base metrics
MetricListService.destroyMetric(this.metric.name);

WidgetDataModel.prototype.destroy.call(this);
};

return DataModel;
}

angular
.module('datamodel')
.factory('BccUprobehitsMetricDataModel', BccUprobehitsMetricDataModel);
})();

0 comments on commit 4c3ab35

Please sign in to comment.