Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
a85f0bfe
Commit
a85f0bfe
authored
Apr 11, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make loading of System Load in Details optional
The system.load.average.1m metric is not available on all platforms. Therefore we ignore errors from fetching it. closes #697
parent
306f0326
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
42 deletions
+53
-42
package-lock.json
spring-boot-admin-server-ui/package-lock.json
+9
-9
package.json
spring-boot-admin-server-ui/package.json
+3
-3
details-process.vue
...main/frontend/views/instances/details/details-process.vue
+41
-30
No files found.
spring-boot-admin-server-ui/package-lock.json
View file @
a85f0bfe
...
...
@@ -8651,9 +8651,9 @@
"dev"
:
true
},
"popper.js"
:
{
"version"
:
"1.14.
2
"
,
"resolved"
:
"https://registry.npmjs.org/popper.js/-/popper.js-1.14.
2
.tgz"
,
"integrity"
:
"sha1-
Bm6OFhPmXmm6BQ9LeOe9TI1U5EM
="
"version"
:
"1.14.
3
"
,
"resolved"
:
"https://registry.npmjs.org/popper.js/-/popper.js-1.14.
3
.tgz"
,
"integrity"
:
"sha1-
FDj5jQRqz3tNeM1QK/QYrGTU8JU
="
},
"posix-character-classes"
:
{
"version"
:
"0.1.1"
,
...
...
@@ -13607,9 +13607,9 @@
"integrity"
:
"sha512-/ffmsiVuPC8PsWcFkZngdpas19ABm5mh2wA7iDqcltyCTwlgZjHGeJYOXkBMo422iPwIcviOtrTCUpSfXmToLQ=="
},
"vue-clickaway"
:
{
"version"
:
"2.
1.0
"
,
"resolved"
:
"https://registry.npmjs.org/vue-clickaway/-/vue-clickaway-2.
1.0
.tgz"
,
"integrity"
:
"sha
1-OS3nZHUfMc0geH6Ps6bjGYJfjU8
="
,
"version"
:
"2.
2.2
"
,
"resolved"
:
"https://registry.npmjs.org/vue-clickaway/-/vue-clickaway-2.
2.2
.tgz"
,
"integrity"
:
"sha
512-25SpjXKetL06GLYoLoC8pqAV6Cur9cQ//2g35GRFBV4FgoljbZZjTINR8g2NuVXXDMLSUXaKx5dutgO4PaDE7A=
="
,
"requires"
:
{
"loose-envify"
:
"1.3.1"
}
...
...
@@ -13635,9 +13635,9 @@
"dev"
:
true
},
"vue-jest"
:
{
"version"
:
"2.
3.0
"
,
"resolved"
:
"https://registry.npmjs.org/vue-jest/-/vue-jest-2.
3.0
.tgz"
,
"integrity"
:
"sha512-
c/ZxWSBA30AXfheSCe9YoFXsVQQh3mv99+GOTuG3hQf1CDuFU9y936EeNs/xM/bgaUvhyfzAb2TVMlmYGG3P3Q
=="
,
"version"
:
"2.
4.1
"
,
"resolved"
:
"https://registry.npmjs.org/vue-jest/-/vue-jest-2.
4.1
.tgz"
,
"integrity"
:
"sha512-
LpiUwga4xmzmpUY73gMnujryZvXJ9a273LWG4Kuz9Rw47Vnav86Fe/+h8tAOR4w/zRb5JBy5WgisoCIPTUzQew
=="
,
"dev"
:
true
,
"requires"
:
{
"babel-plugin-transform-es2015-modules-commonjs"
:
"6.26.0"
,
...
...
spring-boot-admin-server-ui/package.json
View file @
a85f0bfe
...
...
@@ -29,12 +29,12 @@
"lodash"
:
"^4.17.5"
,
"moment"
:
"^2.22.0"
,
"moment-shortformat"
:
"^2.1.0"
,
"popper.js"
:
"^1.14.
2
"
,
"popper.js"
:
"^1.14.
3
"
,
"pretty-bytes"
:
"^4.0.2"
,
"resize-observer-polyfill"
:
"^1.5.0"
,
"rxjs"
:
"^5.5.8"
,
"vue"
:
"^2.5.16"
,
"vue-clickaway"
:
"^2.
1.0
"
,
"vue-clickaway"
:
"^2.
2.2
"
,
"vue-router"
:
"^3.0.1"
,
"yamljs"
:
"^0.3.0"
},
...
...
@@ -72,7 +72,7 @@
"sass-loader"
:
"^6.0.7"
,
"style-loader"
:
"^0.20.3"
,
"url-loader"
:
"^0.6.2"
,
"vue-jest"
:
"^2.
3.0
"
,
"vue-jest"
:
"^2.
4.1
"
,
"vue-loader"
:
"^14.2.2"
,
"vue-svg-loader"
:
"^0.5.0"
,
"vue-template-compiler"
:
"^2.5.16"
,
...
...
spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue
View file @
a85f0bfe
...
...
@@ -33,24 +33,24 @@
<p
v-text=
"pid"
/>
</div>
</div>
<div
class=
"level-item has-text-centered"
v-if=
"
metrics['process.uptime']
"
>
<div
class=
"level-item has-text-centered"
v-if=
"
uptime
"
>
<div>
<p
class=
"heading"
>
Uptime
</p>
<p>
<process-uptime
:value=
"
metrics['process.uptime']
"
/>
<process-uptime
:value=
"
uptime
"
/>
</p>
</div>
</div>
<div
class=
"level-item has-text-centered"
v-if=
"
metrics['system.cpu.count']
"
>
<div
class=
"level-item has-text-centered"
v-if=
"
cpuCount
"
>
<div>
<p
class=
"heading"
>
CPUs
</p>
<p
v-text=
"
metrics['system.cpu.count']
"
/>
<p
v-text=
"
cpuCount
"
/>
</div>
</div>
<div
class=
"level-item has-text-centered"
v-if=
"
metrics['system.load.average.1m']
"
>
<div
class=
"level-item has-text-centered"
v-if=
"
systemLoad
"
>
<div>
<p
class=
"heading"
>
System Load (last 1m)
</p>
<p
v-text=
"
metrics['system.load.average.1m']
.toFixed(2)"
/>
<p
v-text=
"
systemLoad
.toFixed(2)"
/>
</div>
</div>
</div>
...
...
@@ -60,7 +60,6 @@
<
script
>
import
Instance
from
'@/services/instance'
;
import
_
from
'lodash'
import
processUptime
from
'./process-uptime'
;
export
default
{
...
...
@@ -75,43 +74,55 @@
hasLoaded
:
false
,
error
:
null
,
pid
:
null
,
metrics
:
{
'process.uptime'
:
null
,
'system.load.average.1m'
:
null
,
'system.cpu.count'
:
null
,
}
uptime
:
null
,
systemLoad
:
null
,
cpuCount
:
null
}),
created
()
{
this
.
fetchMetrics
();
this
.
fetchUptime
();
this
.
fetchCpuCount
();
this
.
fetchSystemLoad
();
this
.
fetchPid
();
},
methods
:
{
async
fetchMetrics
()
{
if
(
this
.
instance
)
{
const
vm
=
this
;
vm
.
error
=
null
;
try
{
await
Promise
.
all
(
_
.
entries
(
vm
.
metrics
)
.
map
(
async
([
name
])
=>
{
const
response
=
await
vm
.
instance
.
fetchMetric
(
name
);
vm
.
metrics
[
name
]
=
response
.
data
.
measurements
[
0
].
value
;
}
));
}
catch
(
error
)
{
console
.
warn
(
'Fetching process metrics failed:'
,
error
);
this
.
error
=
error
;
}
this
.
hasLoaded
=
true
;
async
fetchUptime
()
{
try
{
this
.
uptime
=
await
this
.
fetchMetric
(
'process.uptime'
);
}
catch
(
error
)
{
this
.
error
=
error
;
console
.
warn
(
'Fetching Uptime failed:'
,
error
);
}
this
.
hasLoaded
=
true
;
},
async
fetchSystemLoad
()
{
try
{
this
.
systemLoad
=
await
this
.
fetchMetric
(
'system.load.average.1m'
);
}
catch
(
error
)
{
console
.
warn
(
'Fetching System Load failed:'
,
error
);
}
this
.
hasLoaded
=
true
;
},
async
fetchCpuCount
()
{
try
{
this
.
cpuCount
=
await
this
.
fetchMetric
(
'system.cpu.count'
);
}
catch
(
error
)
{
console
.
warn
(
'Fetching Cpu Count failed:'
,
error
);
}
this
.
hasLoaded
=
true
;
},
async
fetchMetric
(
name
)
{
const
response
=
await
this
.
instance
.
fetchMetric
(
name
);
return
response
.
data
.
measurements
[
0
].
value
;
},
async
fetchPid
()
{
if
(
this
.
instance
&&
this
.
instance
.
hasEndpoint
(
'env'
))
{
if
(
this
.
instance
.
hasEndpoint
(
'env'
))
{
try
{
const
response
=
await
this
.
instance
.
fetchEnv
(
'PID'
);
this
.
pid
=
response
.
data
.
property
.
value
;
}
catch
(
error
)
{
console
.
warn
(
'Fetching PID failed:'
,
error
);
}
this
.
hasLoaded
=
true
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment