[gnome-ostree] repoweb: Add system load average
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree] repoweb: Add system load average
- Date: Wed, 18 Jul 2012 22:42:44 +0000 (UTC)
commit ff6c0478b334abe6c2a4586fa02a944d1b27fd66
Author: Colin Walters <walters verbum org>
Date: Wed Jul 18 18:41:53 2012 -0400
repoweb: Add system load average
qa/repoweb/repoweb.js | 5 +++++
src/ostbuild/pyostbuild/builtin_repoweb_json.py | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/qa/repoweb/repoweb.js b/qa/repoweb/repoweb.js
index 81e2bf4..ce53059 100644
--- a/qa/repoweb/repoweb.js
+++ b/qa/repoweb/repoweb.js
@@ -25,6 +25,11 @@ function repoweb_index_init() {
$(repoDataSignal).on("loaded", function () {
$("#repoweb-summary").empty();
var summary = $("#repoweb-summary").get(0);
+
+ var load = document.createElement('div');
+ load.appendChild(document.createTextNode('System load: ' + repoData['load']));
+ summary.appendChild(load);
+
var targets = repoData['targets'];
for (var name in targets) {
var elt;
diff --git a/src/ostbuild/pyostbuild/builtin_repoweb_json.py b/src/ostbuild/pyostbuild/builtin_repoweb_json.py
index 0fab3bc..d550c38 100755
--- a/src/ostbuild/pyostbuild/builtin_repoweb_json.py
+++ b/src/ostbuild/pyostbuild/builtin_repoweb_json.py
@@ -49,6 +49,11 @@ class OstbuildRepoWebJson(builtins.Builtin):
output = {'00ostbuild-repoweb-json-version': 0}
+ f = open('/proc/loadavg')
+ loadavg = f.read().strip()
+ f.close()
+ output['load'] = loadavg
+
targets_list = []
for target_component_type in ['runtime', 'devel']:
for architecture in self.snapshot['architectures']:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]