[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 16/29] Plan reporting: Provide get-last-plan queuedaemon command



This allows retrieval, by monitoring clients which are not
participating in the planning queue, of the finished projection, or
the unfinished plan as it was at the time of last restart.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
v2: Fix invocation of return-plan-to-client.
    Use data-W.final.pl, not data-W-final.pl, to fit
        with existing .gitignore, and be slightly neater.
---
 README.planner |   11 +++++++++++
 ms-queuedaemon |    8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/README.planner b/README.planner
index b1bacd4..21b3415 100644
--- a/README.planner
+++ b/README.planner
@@ -224,6 +224,17 @@ ms-queuedaemon commands
 
        > thought-done | thought-wait
 
+        > get-last-plan projection|plan
+                Retrieve the last fully completed plan (`projection'),
+               or the most recent short-term information used for
+               actual resource allocation (`plan').
+
+               For monitoring tools, not participants in the resource
+               allocation process.  Response is as for get-plan:
+
+               < OK get-plan BYTES
+               PLAN-DATA
+
 
 Plan is:
        Start   time_t used for "now" *
diff --git a/ms-queuedaemon b/ms-queuedaemon
index 8c9af81..18d703e 100755
--- a/ms-queuedaemon
+++ b/ms-queuedaemon
@@ -293,6 +293,7 @@ proc report-plan {w wo} {
     } emsg]} {
         log "INTERNAL ERROR showing $w html: $emsg"
     } else {
+       file copy -force data-$w.pl data-$wo.final.pl
         log "$w report-plan OK"
     }
 }
@@ -367,6 +368,13 @@ proc cmd/get-plan {chan desc} {
     set plan [return-plan-to-client $chan $w]
 }
 
+proc cmd/get-last-plan {chan desc w} {
+    global walkers
+    if {[lsearch -exact $walkers $w] < 0} { error "unknown last-plan ($w)" }
+    if {![file exists data-$w.final.pl]} { error "no last-plan $w" }
+    return-plan-to-client $chan $w.final
+}
+
 proc cmd/book-resources {chan desc bytes} {
     read-chan-data $chan $bytes do-book-resources
 }
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.