From patchwork Mon Apr 28 09:24:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 29191 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D076B202FE for ; Mon, 28 Apr 2014 09:26:52 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf4396287ykp.1 for ; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=zwkI2W4YCS024PvvjmtukBP09BSEE7nBjeSwFUe0Gn8=; b=DtMW+jNCKWxzWCibiG8TUYM+Gt0vbiRoFhRdYCwKnkkMacmdmJRNdwxeBU1xu+jphS NpS1tus9ODqMDK/XshFwGz9UsdXbndOadEE+ndPE+n01PA63rAD/FfCBw3jzTN6wU+TW OzTbBa59gZMkCpN1WTUr+aSLibtogzlWgOZsH8vn2Z2Ovz0kpIc2KM/Y32DG7zTXEeAp qmaG0EplT3Rx+0Dktx+x/slKcU0rpP2NwTxcA2ocy4fmyVn0/qp7FqoI3wBeTlUAlbrQ 2RgDcqOyCiSdUdW9R9um5RlNRQRB/aOz5hUgkDhh9Nve9yMnzmxGHy9T2Il2Nw3W8E7g 51SQ== X-Gm-Message-State: ALoCoQk0SOc/FdFs4vBrSIwU7wnDWcEGE//2upOYinQHfOVhikjXYZOud359UOsQKb0Jz063Fx0j X-Received: by 10.236.149.115 with SMTP id w79mr4292811yhj.41.1398677212612; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.8 with SMTP id j8ls2564666qge.45.gmail; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr22136457vec.19.1398677212412; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ls10si3492691vec.172.2014.04.28.02.26.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 02:26:52 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ib6so1399210vcb.33 for ; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-Received: by 10.58.202.133 with SMTP id ki5mr22136453vec.19.1398677212324; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp102620vcb; Mon, 28 Apr 2014 02:26:52 -0700 (PDT) X-Received: by 10.224.12.138 with SMTP id x10mr31298091qax.80.1398677211965; Mon, 28 Apr 2014 02:26:51 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id r90si7538969qgr.73.2014.04.28.02.26.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Apr 2014 02:26:51 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Weho6-0007ky-GI; Mon, 28 Apr 2014 09:25:02 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Weho4-0007kl-Gp for xen-devel@lists.xen.org; Mon, 28 Apr 2014 09:25:00 +0000 Received: from [85.158.139.211:18841] by server-11.bemta-5.messagelabs.com id 4F/5C-30804-B6E1E535; Mon, 28 Apr 2014 09:24:59 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1398677097!937001!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11674 invoked from network); 28 Apr 2014 09:24:59 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Apr 2014 09:24:59 -0000 X-IronPort-AV: E=Sophos;i="4.97,942,1389744000"; d="scan'208";a="124269250" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 28 Apr 2014 09:24:45 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Mon, 28 Apr 2014 05:24:44 -0400 Received: from kazak.uk.xensource.com ([10.80.2.80] helo=zakaz.uk.xensource.com) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1Wehnm-0006XK-NL; Mon, 28 Apr 2014 10:24:43 +0100 Received: by zakaz.uk.xensource.com (sSMTP sendmail emulation); Mon, 28 Apr 2014 10:24:42 +0100 From: Ian Campbell To: Date: Mon, 28 Apr 2014 10:24:42 +0100 Message-ID: <1398677082-30965-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.9.0 MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [OSSTEST] ms-planner: add a flight summary html report X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: I often find myself intested in when a given flight (or the current flight for a branch) will complete, which with the current resource plan means searching and cycling through trying to figure out which box ends the latest. Add an explicit flight status summary, which produces a table for each flight listing the jobs, there start and end times and the host they run on. The output is something like a list of these, ordered by flight number (rendered with links(1), header is bold): Flight 26043 [linux-3.4 real] 4 jobs expected to run until 2014-Apr-27 Sun 23:54:19 build-amd64-pvops 2014-Apr-27 Sun 20:06:09 2014-Apr-27 Sun 21:21:23 host leaf-beetle build-i386-pvops 2014-Apr-27 Sun 21:20:15 2014-Apr-27 Sun 21:31:27 host grain-weevil build-amd64 2014-Apr-27 Sun 21:21:23 2014-Apr-27 Sun 21:44:22 host leaf-beetle build-i386 2014-Apr-27 Sun 22:18:43 2014-Apr-27 Sun 23:54:19 host field-cricket I renamed the existing show-html option to show-resource-plan-html for clarity. Signed-off-by: Ian Campbell --- It'd be good to sync these reports to e.g. xenbits so other people can see them. Pressumably this would be reasonably easy with a ssh keypair restricted in authorized_keys. --- ms-planner | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- ms-queuedaemon | 10 ++++++-- 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/ms-planner b/ms-planner index f045bbf..4d9787d 100755 --- a/ms-planner +++ b/ms-planner @@ -536,7 +536,80 @@ sub showsharetype ($) { return $_; } -sub cmd_show_html () { +sub cmd_show_flight_summary_html () { + get_current_plan(); + + my $earliest= $plan->{Start}; + + my %flights; + my $jobs = 0; + while (my ($reso,$evts) = each %{ $plan->{Events} }) { + # [osstest real] job 26010.test-amd64-amd64-xl-win7-amd64 + foreach my $evt ( @{$evts} ) { + next unless $evt->{Type} =~ m/^(Start|End)$/; + next unless $evt->{Info} =~ m/^\[(\S+) (\S+)\] job ([0-9]+)\.(\S+) (.*)/; + my ($branch,$blessing,$flight,$job,$rest) = ($1,$2,$3,$4,$5); + $flights{$flight} = { + Branch => $branch, + Blessing => $blessing, + End => $evt->{Time}, + Jobs => {}, + Last => $evt, + LastReso => $reso, + } unless $flights{$flight}; + $jobs++; + $flights{$flight}->{Jobs}{$job} = { + Reso => $reso + } unless $flights{$flight}->{Jobs}{$job}; + + $flights{$flight}->{Jobs}{$job}->{Start} = $evt if $evt->{Type} eq "Start"; + $flights{$flight}->{Jobs}{$job}->{End} = $evt if $evt->{Type} eq "End"; + + if ( $evt->{Time} > $flights{$flight}->{End} ) { + $flights{$flight}->{Last} = $evt; + $flights{$flight}->{LastReso} = $reso; + $flights{$flight}->{End} = $evt->{Time}; + } + } + } + + my @cols = ("Job", "Start", "End", "Host"); + + printf("\n\n"); + printf(" \n", encode_entities($_)) foreach @cols; + printf("\n"); + + sub flight_hdr($) { + my $text = encode_entities(shift); + printf("", scalar @cols); + } + sub cell($) { + my $text = encode_entities(shift); + printf(" \n"); + } + foreach my $flight (sort keys %flights) { + my $inf = $flights{$flight}; + + flight_hdr("Flight $flight [$inf->{Branch} $inf->{Blessing}] ". + (keys %{$inf->{Jobs}})." jobs ". + "expected to run until ".strftime("%Y-%b-%d %a %H:%M:%S", localtime $inf->{End})); + + foreach my $job (sort { $inf->{Jobs}{$a}->{Start}->{Time} cmp $inf->{Jobs}{$b}->{Start}->{Time} } keys %{ $inf->{Jobs} }) { + my $sevt = $inf->{Jobs}{$job}->{Start}; + my $eevt = $inf->{Jobs}{$job}->{End}; + print("\n"); + cell($job); + cell(strftime("%Y-%b-%d %a %H:%M:%S", localtime $inf->{Jobs}{$job}->{Start}->{Time})); + cell(strftime("%Y-%b-%d %a %H:%M:%S", localtime $inf->{Jobs}{$job}->{End}->{Time})); + cell($inf->{Jobs}{$job}->{Reso}); + print("\n"); + } + print("\n"); + } + print("
%s
$text
$text
 
\n"); +} + +sub cmd_show_resource_plan_html () { get_current_plan(); my $now= time; diff --git a/ms-queuedaemon b/ms-queuedaemon index 26d83e2..a5bebd3 100755 --- a/ms-queuedaemon +++ b/ms-queuedaemon @@ -224,12 +224,18 @@ proc queuerun-perhaps-step {} { proc report-plan {} { global c if {[catch { - exec ./ms-planner show-html > "$c(WebspaceFile)/resource-plan.html" + exec ./ms-planner show-resource-plan-html > "$c(WebspaceFile)/resource-plan.html" } emsg]} { - log "INTERNAL ERROR showing plan html: $emsg" + log "INTERNAL ERROR showing resource plan html: $emsg" } else { log "report-plan OK" } + if {[catch { + exec ./ms-planner show-flight-summary-html > "$c(WebspaceFile)/flight-summary.html" + } emsg]} { + log "INTERNAL ERROR showing flight summary html: $emsg" + } else { + log "report-flight-summary OK" } proc we-are-thinking {chan} {