Skip to content

Commit

Permalink
PAYARA-4236 add HTTP thread pool usage statistic and used it for Core…
Browse files Browse the repository at this point in the history
… view; colors from design system
  • Loading branch information
jbee committed Oct 31, 2019
1 parent 2777d5f commit f2d5c4b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
only if the new code is made subject to such option by the copyright
holder.
*/

body {
background-color: #002c3e;
font: 13px/1.231 helvetica,clean,sans-serif;
font: 13px/1.231 'IBM Plex Sans', helvetica,clean,sans-serif;
color: white;
margin: 0;
padding: 0;
Expand Down Expand Up @@ -75,15 +74,21 @@ button {
padding: 5px 1em;
margin: 0 1px;
font-weight: normal;
background-color: #F0981B;
background: rgb(240,152,27);
box-shadow: 0px 3px 3px rgba(67,68,69,0.05),
0px 2px 2px rgba(67,68,69,0.1),
0px 1px 1px rgba(67,68,69,0.15);
border-width: 0;
color: white;
color: #101012;
border-radius: 2px;
cursor: pointer;
line-height: 1.0;
font-weight: 500;
}
button:hover {
background-color: #F1A232;
background: rgba(240,152,27,0.9);
box-shadow: 0px 1px 1px rgba(16,16,18,0.3);
transform : translateY(1px);
}
#logo {
height: 30px;
Expand Down Expand Up @@ -173,8 +178,7 @@ button:hover {
position: relative;
}
#chart-grid td.chart-selected h3 {
color: #00618A;
background-color: white;
background-color: #0096D6;
}
.stable {
background-color: rgba(153, 102, 255, 0.2);
Expand Down Expand Up @@ -388,16 +392,20 @@ table.tags th, table.tags td {
text-align: left;
}
.Menu button {
color: #bbb;
color: white;
background-color: transparent;
padding: 5px;
padding: 0.5em 1em;
display: inline-block;
text-align: left;
border-radius: 0px;
box-shadow: none;
}
.Menu button:hover {
color: white;
background-color: transparent;
color: #434445;
background-color: #D2D8DA;
}
.Menu button:disabled {
color: #888;
color: #DAE0E2;
cursor: not-allowed;
}
.Menu .Item {
Expand All @@ -411,14 +419,15 @@ table.tags th, table.tags td {
float: none;
display: block;
white-space: nowrap;
width: 100%;
}
.Menu .Group {
display: none;
position: absolute;
z-index: 200;
background-color: #002c3e;
background-color: #0096D6;
overflow: hidden;
border: 1px solid #aaa;
padding: 0;
}
.Menu .Item:hover .Group {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,29 @@ MonitoringConsole.Model = (function() {
numberOfColumns: 3,
widgets: [
{ series: 'ns:jvm HeapUsage', unit: 'percent',
grid: { item: 0, column: 0, span: 1},
grid: { item: 1, column: 0, span: 1},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'now', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:jvm CpuUsage', unit: 'percent',
grid: { item: 1, column: 0, span: 1},
grid: { item: 1, column: 1, span: 1},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'now', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:jvm ThreadCount', unit: 'count',
grid: { item: 0, column: 1, span: 1}},
{ series: 'ns:http ThreadPoolCurrentThreadsBusy', unit: 'count',
grid: { item: 1, column: 1, span: 1},
status: { missing: { hint: TEXT_HTTP_HIGH }}},
{ series: 'ns:http ThreadPoolCurrentThreadUsage', unit: 'percent',
grid: { item: 1, column: 2, span: 1},
status: { missing: { hint: TEXT_HTTP_HIGH }},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'avg', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:web RequestCount', unit: 'count',
grid: { item: 0, column: 2, span: 1},
options: { perSec: true },
status: { missing: { hint: TEXT_WEB_HIGH }}},
{ series: 'ns:web ActiveSessions', unit: 'count',
grid: { item: 1, column: 2, span: 1},
grid: { item: 0, column: 0, span: 1},
status: { missing: { hint: TEXT_WEB_HIGH }}},
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,29 @@ MonitoringConsole.Model = (function() {
numberOfColumns: 3,
widgets: [
{ series: 'ns:jvm HeapUsage', unit: 'percent',
grid: { item: 0, column: 0, span: 1},
grid: { item: 1, column: 0, span: 1},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'now', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:jvm CpuUsage', unit: 'percent',
grid: { item: 1, column: 0, span: 1},
grid: { item: 1, column: 1, span: 1},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'now', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:jvm ThreadCount', unit: 'count',
grid: { item: 0, column: 1, span: 1}},
{ series: 'ns:http ThreadPoolCurrentThreadsBusy', unit: 'count',
grid: { item: 1, column: 1, span: 1},
status: { missing: { hint: TEXT_HTTP_HIGH }}},
{ series: 'ns:http ThreadPoolCurrentThreadUsage', unit: 'percent',
grid: { item: 1, column: 2, span: 1},
status: { missing: { hint: TEXT_HTTP_HIGH }},
axis: { min: 0, max: 100 },
decorations: {
thresholds: { reference: 'avg', alarming: { value: 50, display: true }, critical: { value: 80, display: true }}}},
{ series: 'ns:web RequestCount', unit: 'count',
grid: { item: 0, column: 2, span: 1},
options: { perSec: true },
status: { missing: { hint: TEXT_WEB_HIGH }}},
{ series: 'ns:web ActiveSessions', unit: 'count',
grid: { item: 1, column: 2, span: 1},
grid: { item: 0, column: 0, span: 1},
status: { missing: { hint: TEXT_WEB_HIGH }}},
]
},
Expand Down Expand Up @@ -2956,7 +2959,7 @@ MonitoringConsole.View = (function() {
})
},
{ label: 'Include in Rotation', type: 'checkbox', value: MonitoringConsole.Model.Page.rotate(), onChange: (checked) => MonitoringConsole.Model.Page.rotate(checked) },
{ label: 'Widgets', input: () =>
{ label: 'Add Widgets', input: () =>
$('<span/>')
.append(nsSelection)
.append(widgetsSelection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ public CountStatistic getCurrentThreadsBusy() {
return currentThreadsBusy;
}

public CountStatistic getCurrentThreadUsage() {
long usage = 100 * getCurrentThreadsBusy().getCount() / getCurrentThreadCount().getCount();
CountStatisticImpl stats = new CountStatisticImpl("CurrentThreadUsage",
"%", "Percentage of threads currently busy");
stats.setCount(usage);
return stats;
}

@ProbeListener("glassfish:kernel:thread-pool:setMaxThreadsEvent")
public void setMaxThreadsEvent(
@ProbeParam("monitoringId") String monitoringId,
Expand Down

0 comments on commit f2d5c4b

Please sign in to comment.