Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a little jmx widget repository and define types so that we can de…
…fine potential dashboard widgets for JMX attributes
- Loading branch information
Showing
3 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
module Jmx { | ||
|
||
export function createDashboardLink(widgetType, widget) { | ||
var href = "#" + widgetType.route; | ||
var routeParams = angular.toJson(widget); | ||
var title = widget.title; | ||
var size = angular.toJson({ | ||
size_x: widgetType.size_x, | ||
size_y: widgetType.size_y | ||
}); | ||
|
||
return "/dashboard/add?tab=dashboard" + | ||
"&href=" + encodeURIComponent(href) + | ||
"&size=" + encodeURIComponent(size) + | ||
"&title=" + encodeURIComponent(title) + | ||
"&routeParams=" + encodeURIComponent(routeParams); | ||
} | ||
|
||
export function getWidgetType(widget) { | ||
return jmxWidgetTypes.find((type) => { | ||
return type.type === widget.type; | ||
}); | ||
} | ||
|
||
export var jmxWidgetTypes = [ | ||
{ | ||
type: "donut", | ||
icon: "icon-smile", | ||
route: "/jmx/widget/donut", | ||
size_x: 1, | ||
size_y: 1, | ||
title: "Add Donut chart to Dashboard" | ||
} | ||
]; | ||
|
||
export var jmxWidgets = [ | ||
{ | ||
type: "donut", | ||
title: "Java Heap Memory", | ||
mbean: "java.lang:type=Memory", | ||
attribute: "HeapMemoryUsage", | ||
total: "Max", | ||
terms: "Used" | ||
}, | ||
{ | ||
type: "donut", | ||
title: "Java Non Heap Memory", | ||
mbean: "java.lang:type=Memory", | ||
attribute: "NonHeapMemoryUsage", | ||
total: "Max", | ||
terms: "Used" | ||
}, | ||
{ | ||
type: "donut", | ||
title: "File Descriptor Usage", | ||
mbean: "java.lang:type=OperatingSystem", | ||
total: "MaxFileDescriptorCount", | ||
terms: "OpenFileDescriptorCount" | ||
}, | ||
{ | ||
type: "donut", | ||
title: "Loaded Clases", | ||
mbean: "java.lang:type=ClassLoading", | ||
total: "TotalLoadedClassCount", | ||
terms: "LoadedClassCount,UnloadedClassCount" | ||
}, | ||
{ | ||
type: "donut", | ||
title: "Free Memory", | ||
mbean: "java.lang:type=OperatingSystem", | ||
total: "TotalPhysicalMemorySize", | ||
terms: "FreePhysicalMemorySize" | ||
}, | ||
{ | ||
type: "donut", | ||
title: "Swap Size", | ||
mbean: "java.lang:type=OperatingSystem", | ||
total: "TotalSwapSpaceSize", | ||
terms: "FreeSwapSpaceSize" | ||
} | ||
]; | ||
|
||
|
||
} |