Skip to content

Commit

Permalink
Major restructuring for remote collection
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Sep 2, 2015
1 parent c1a8ecb commit 65da9a1
Show file tree
Hide file tree
Showing 473 changed files with 15,240 additions and 13,649 deletions.
3 changes: 1 addition & 2 deletions api/src/main/java/org/glowroot/api/Glowroot.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public class Glowroot {
static {
GlowrootService service;
try {
Class<?> registryClass =
Class.forName("org.glowroot.transaction.ServiceRegistryImpl");
Class<?> registryClass = Class.forName("org.glowroot.agent.impl.ServiceRegistryImpl");
Method getInstanceMethod = registryClass.getMethod("getGlowrootService");
service = (GlowrootService) getInstanceMethod.invoke(null);
if (service == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public interface Aggregate {

long totalMicros();

long errorCount();

long transactionCount();

long errorCount();

long totalCpuMicros(); // -1 means N/A

long totalBlockedMicros(); // -1 means N/A
Expand Down
22 changes: 11 additions & 11 deletions core/app/hbs/trace-entry.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,50 @@
</span>
</div>
<div style="overflow: hidden; padding-left: 0.5em;">
{{#if message}}
{{#ifLongMessage message.text}}
{{#ifNotNull messageText}}
{{#ifLongMessage messageText}}
{{! surrounding div is needed as common parent for toggling unexpanded/expanded content }}
<div>
<div class="gt-inline-block gt-unexpanded-content">
{{firstPart message.text}}
{{firstPart messageText}}
<span class="gt-link-color"><strong>...</strong></span>
{{lastPart message.text}}
{{lastPart messageText}}
</div>
<!-- only convert newlines to <br>s for long messages -->
<div class="gt-expanded-content gt-with-clip hide"
style="position: relative; display: inline-block;">
<i class="fa fa-clipboard gt-clip"></i>
<div class="gt-break-word gt-pre-wrap"><!--
lack of space here is significant because of gt-pre-wrap
-->{{message.text}}<!--
-->{{messageText}}<!--
--></div>
</div>
</div>
{{^}}
{{! surrounding div is needed as common parent for toggling unexpanded/expanded content }}
<div>
<div class="gt-inline-block gt-unexpanded-content">
{{message.text}}
{{messageText}}
</div>
<div class="gt-expanded-content gt-with-clip hide"
style="position: relative; display: inline-block;">
<i class="fa fa-clipboard gt-clip"></i>
<div class="gt-break-word gt-pre-wrap"><!--
lack of space here is significant because of gt-pre-wrap
-->{{message.text}}<!--
-->{{messageText}}<!--
--></div>
</div>
</div>
{{/ifLongMessage}}
{{#if message.detail}}
{{#ifNonEmptyObject messageDetail}}
<div class="gt-content-detail">
<span class="gt-inline-block gt-unexpanded-content gt-link-color">detail</span>
<span class="gt-inline-block gt-expanded-content hide">
{{{messageDetailHtml message.detail}}}
{{{messageDetailHtml messageDetail}}}
</span>
</div>
{{/if}}
{{/if}}
{{/ifNonEmptyObject}}
{{/ifNotNull}}
{{#if error}}
<div class="{{{errorIndentClass message}}}">
<div>
Expand Down
32 changes: 16 additions & 16 deletions core/app/hbs/trace.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</tr>
</thead>
<tbody>
{{#eachTimerFlattenedOrdered timers}}
{{#eachTimerFlattenedOrdered rootTimer}}
<tr class="align-top">
<td style="text-align: left;">
<div style="margin-left: {{timerIndent .}}em;">
Expand Down Expand Up @@ -110,7 +110,7 @@
</tr>
</thead>
<tbody>
{{#eachTimerOrdered timers}}
{{#eachTimerOrdered rootTimer}}
<tr class="align-top">
<td style="text-align: left;">
<div style="margin-left: {{timerIndent .}}em;">
Expand All @@ -131,42 +131,42 @@
<div class="gt-bold">
JVM thread metrics
</div>
{{#ifExists threadCpuTime}}
{{#ifNotNA threadCpuTime}}
<div class="gt-indent2">
<span>CPU time:</span>
{{nanosToMillis threadCpuTime}} milliseconds
</div>
{{/ifExists}}
{{#ifExists threadBlockedTime}}
{{/ifNotNA}}
{{#ifNotNA threadBlockedTime}}
<div class="gt-indent2">
<span>Blocked time:</span>
{{nanosToMillis threadBlockedTime}} milliseconds
</div>
{{/ifExists}}
{{#ifExists threadWaitedTime}}
{{/ifNotNA}}
{{#ifNotNA threadWaitedTime}}
<div class="gt-indent2">
<span>Waited time:</span>
{{nanosToMillis threadWaitedTime}} milliseconds
</div>
{{/ifExists}}
{{#ifExists threadAllocatedBytes}}
{{/ifNotNA}}
{{#ifNotNA threadAllocatedBytes}}
<div class="gt-indent2">
<span>Allocated memory:</span>
{{formatAllocatedBytes threadAllocatedBytes}}
</div>
{{/ifExists}}
{{/ifNotNA}}
{{/ifAnyThreadInfo}}
{{#if gcInfos}}
{{#ifNonEmptyObject gcActivity}}
<div class="gt-bold">
GC info
GC activity
</div>
{{#eachGcInfoOrdered gcInfos}}
{{#eachGcActivityOrdered gcActivity}}
<div class="gt-indent2">
<span>{{name}}:</span>
<span>{{key}}:</span>
{{collectionTime}} milliseconds ({{collectionCount}} collection{{#ifNotOne collectionCount}}s{{/ifNotOne}})
</div>
{{/eachGcInfoOrdered}}
{{/if}}
{{/eachGcActivityOrdered}}
{{/ifNonEmptyObject}}
<br>
{{#ifExistenceYes entriesExistence}}
<div>
Expand Down
2 changes: 1 addition & 1 deletion core/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
<script src="scripts/controllers/transaction/flame-graph.js"></script>
<script src="scripts/controllers/transaction/error-messages.js"></script>
<script src="scripts/controllers/jvm.js"></script>
<script src="scripts/controllers/jvm/gauges.js"></script>
<script src="scripts/controllers/jvm/gauge-values.js"></script>
<script src="scripts/controllers/jvm/mbean-tree.js"></script>
<script src="scripts/controllers/jvm/thread-dump.js"></script>
<script src="scripts/controllers/jvm/heap-dump.js"></script>
Expand Down
12 changes: 6 additions & 6 deletions core/app/scripts/controllers/config/gauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ glowroot.controller('ConfigGaugeCtrl', [
angular.forEach(data.mbeanAvailableAttributeNames, function (mbeanAttributeName) {
allMBeanAttributes[mbeanAttributeName] = {
checked: false,
everIncreasing: false,
counter: false,
available: true
};
});
angular.forEach(data.config.mbeanAttributes, function (mbeanAttr) {
var mbeanAttribute = allMBeanAttributes[mbeanAttr.name];
if (mbeanAttribute) {
mbeanAttribute.checked = true;
mbeanAttribute.everIncreasing = mbeanAttr.everIncreasing;
mbeanAttribute.counter = mbeanAttr.counter;
} else {
allMBeanAttributes[mbeanAttr.name] = {
checked: true,
everIncreasing: mbeanAttr.everIncreasing,
counter: mbeanAttr.counter,
available: false
};
}
Expand All @@ -74,7 +74,7 @@ glowroot.controller('ConfigGaugeCtrl', [
$scope.allMBeanAttributes.push({
name: key,
checked: value.checked,
everIncreasing: value.everIncreasing,
counter: value.counter,
available: value.available
});
});
Expand Down Expand Up @@ -108,7 +108,7 @@ glowroot.controller('ConfigGaugeCtrl', [
if (mbeanAttribute.checked) {
$scope.config.mbeanAttributes.push({
name: mbeanAttribute.name,
everIncreasing: mbeanAttribute.everIncreasing
counter: mbeanAttribute.counter
});
}
});
Expand Down Expand Up @@ -183,7 +183,7 @@ glowroot.controller('ConfigGaugeCtrl', [
$scope.allMBeanAttributes.push({
name: mbeanAttribute,
checked: false,
everIncreasing: false,
counter: false,
available: true
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* global glowroot, angular, $, moment */

glowroot.controller('JvmGaugesCtrl', [
glowroot.controller('JvmGaugeValuesCtrl', [
'$scope',
'$location',
'$filter',
Expand All @@ -36,8 +36,6 @@ glowroot.controller('JvmGaugesCtrl', [

var gaugeScales = {};

var gaugeDeltas = {};

var gaugeShortDisplayMap = {};

$scope.gaugeFilter = '';
Expand All @@ -47,7 +45,7 @@ glowroot.controller('JvmGaugesCtrl', [
};

function refreshData() {
charts.refreshData('backend/jvm/gauge-points', chartState, $scope, addToQuery, onRefreshData);
charts.refreshData('backend/jvm/gauge-values', chartState, $scope, addToQuery, onRefreshData);
}

$scope.$watch('[last, chartFrom, chartTo, gaugeNames, chartRefresh]', function (newValues, oldValues) {
Expand Down Expand Up @@ -181,9 +179,6 @@ glowroot.controller('JvmGaugesCtrl', [
angular.forEach(data, function (gauge) {
allGaugeNames.push(gauge.name);
gaugeShortDisplayMap[gauge.name] = gauge.shortDisplay;
if (gauge.everIncreasing) {
gaugeDeltas[gauge.name] = true;
}
});
refreshData();
})
Expand Down Expand Up @@ -211,50 +206,13 @@ glowroot.controller('JvmGaugesCtrl', [

for (var i = 0; i < data.length; i++) {
var dataSeries = data[i];
var j;
var point;
if (gaugeDeltas[dataSeries.name]) {
var deltas = [];
var lastPoint;
if (dataSeries.data.length > 0) {
lastPoint = dataSeries.data[0];
// 2x the rollup interval prior to chartFrom is returned from server, so if the first datapoint is
// visible, that means there was significant gap prior and makes sense to diff delta with 0
// (but if first datapoint is not visible then don't want to include it as it will mess up the scale)
if (lastPoint[0] >= $scope.chartFrom) {
deltas[0] = lastPoint;
}
}
for (j = 1; j < dataSeries.data.length; j++) {
point = dataSeries.data[j];
if (point && lastPoint) {
deltas[j] = [point[0], point[1] - lastPoint[1]];
} else {
deltas[j] = null;
}
if (point) {
lastPoint = point;
}
}
dataSeries.data = deltas;
}
updateYvalMap(dataSeries.name, dataSeries.data);
if (dataSeries.data.length) {
var scale = scalePoints(dataSeries.data);
gaugeScales[dataSeries.name] = scale;
} else {
gaugeScales[dataSeries.name] = undefined;
}
if (gaugeDeltas[dataSeries.name]) {
// now that yval map has correct (possibly negative) values for tooltip
// truncate negative values so they show up on the chart as 0 (tooltip will reveal true value)
for (j = 0; j < dataSeries.data.length; j++) {
point = dataSeries.data[j];
if (point && point[1] < 0) {
point[1] = 0;
}
}
}
}
updateThePlotData(data);
}
Expand Down Expand Up @@ -407,28 +365,6 @@ glowroot.controller('JvmGaugesCtrl', [
return scale + '1';
};

$scope.deltaStyle = function (gaugeName) {
var style = {
border: 'none',
padding: 0
};
if (gaugeDeltas[gaugeName]) {
style.color = '#417998';
} else {
style.color = '#e5e5e5';
}
return style;
};

$scope.toggleDelta = function (gaugeName) {
if (gaugeDeltas[gaugeName]) {
delete gaugeDeltas[gaugeName];
} else {
gaugeDeltas[gaugeName] = true;
}
refreshData();
};

$scope.clickGaugeName = function (gaugeName) {
var index = $scope.gaugeNames.indexOf(gaugeName);
if (index === -1) {
Expand Down
16 changes: 8 additions & 8 deletions core/app/scripts/controllers/jvm/heap-dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ glowroot.controller('JvmHeapDumpCtrl', [
'httpErrors',
function ($scope, $http, httpErrors) {
$scope.checkDiskSpace = function (deferred) {
$scope.checkDiskSpaceResponse = false;
$scope.availableDiskSpace = false;
$scope.heapDumpResponse = false;
$http.post('backend/jvm/check-disk-space', {directory: $scope.data.directory})
$http.post('backend/jvm/available-disk-space', {directory: $scope.directory})
.success(function (data) {
if (data.error) {
deferred.reject(data.error);
} else {
$scope.checkDiskSpaceResponse = data;
$scope.availableDiskSpace = data;
deferred.resolve('See disk space below');
}
})
.error(httpErrors.handler($scope, deferred));
};

$scope.dumpHeap = function (deferred) {
$scope.checkDiskSpaceResponse = false;
$scope.availableDiskSpace = false;
$scope.heapDumpResponse = false;
$http.post('backend/jvm/dump-heap', {directory: $scope.data.directory})
$http.post('backend/jvm/dump-heap', {directory: $scope.directory})
.success(function (data) {
if (data.error) {
deferred.reject(data.error);
Expand All @@ -51,10 +51,10 @@ glowroot.controller('JvmHeapDumpCtrl', [
.error(httpErrors.handler($scope, deferred));
};

$http.get('backend/jvm/heap-dump-defaults')
.success(function (data) {
$http.get('backend/jvm/heap-dump-default-dir')
.success(function (directory) {
$scope.loaded = true;
$scope.data = data;
$scope.directory = directory;
})
.error(httpErrors.handler($scope));
}
Expand Down

0 comments on commit 65da9a1

Please sign in to comment.