You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ma...@apache.org on 2019/08/15 21:09:17 UTC
[incubator-mxnet-ci] branch success-rate created (now 9b37ab5)
This is an automated email from the ASF dual-hosted git repository.
marcoabreu pushed a change to branch success-rate
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-ci.git.
at 9b37ab5 Add jenkins success statistics
This branch includes the following new commits:
new 9b37ab5 Add jenkins success statistics
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-mxnet-ci] 01/01: Add jenkins success statistics
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
marcoabreu pushed a commit to branch success-rate
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-ci.git
commit 9b37ab5bee34c8c652d8c5ef3e9c1f7de64edcdb
Author: Marco de Abreu <ma...@gmail.com>
AuthorDate: Thu Aug 15 23:05:22 2019 +0200
Add jenkins success statistics
---
.gitignore | 1 +
tools/jenkins-success-statistics/README.md | 20 +++++++++++
tools/jenkins-success-statistics/report.py | 58 ++++++++++++++++++++++++++++++
tools/jenkins-success-statistics/run.sh | 20 +++++++++++
4 files changed, 99 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ad27e3a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.DS_STORE
diff --git a/tools/jenkins-success-statistics/README.md b/tools/jenkins-success-statistics/README.md
new file mode 100644
index 0000000..df8d9a8
--- /dev/null
+++ b/tools/jenkins-success-statistics/README.md
@@ -0,0 +1,20 @@
+<!--- Licensed to the Apache Software Foundation (ASF) under one -->
+<!--- or more contributor license agreements. See the NOTICE file -->
+<!--- distributed with this work for additional information -->
+<!--- regarding copyright ownership. The ASF licenses this file -->
+<!--- to you under the Apache License, Version 2.0 (the -->
+<!--- "License"); you may not use this file except in compliance -->
+<!--- with the License. You may obtain a copy of the License at -->
+
+<!--- http://www.apache.org/licenses/LICENSE-2.0 -->
+
+<!--- Unless required by applicable law or agreed to in writing, -->
+<!--- software distributed under the License is distributed on an -->
+<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
+<!--- KIND, either express or implied. See the License for the -->
+<!--- specific language governing permissions and limitations -->
+<!--- under the License. -->
+
+# This calculates the CI success and failure rate for last week
+
+First run ./run.sh then ./report.py
diff --git a/tools/jenkins-success-statistics/report.py b/tools/jenkins-success-statistics/report.py
new file mode 100755
index 0000000..607efe7
--- /dev/null
+++ b/tools/jenkins-success-statistics/report.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python3
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# -*- coding: utf-8 -*-3
+"""Description"""
+
+__author__ = 'Pedro Larroy'
+__version__ = '0.1'
+
+import os
+import sys
+import json
+import dateutil.parser
+import datetime
+
+
+def usage():
+ sys.stderr.write('usage: {0}\n'.format(sys.argv[0]))
+
+
+def main():
+ with open("runs", "r") as f:
+ runs = json.load(f)
+ res = [{"result": x['result'], "endTime": dateutil.parser.parse(x['endTime'], ignoretz=True)} for x in runs if x['endTime']]
+ a_week_ago = datetime.datetime.now()-datetime.timedelta(days=7)
+ last_week_runs = filter(lambda x: x["endTime"] > a_week_ago, res)
+ fails = 0
+ success = 0
+ for x in last_week_runs:
+ if x['result'].lower() == 'success':
+ success += 1
+ else:
+ fails += 1
+ success_rate = float(success)*100 / (success + fails)
+ print("MXNet master CI pass rate {:.0f}%".format(success_rate))
+
+
+ return 1
+
+if __name__ == '__main__':
+ sys.exit(main())
+
diff --git a/tools/jenkins-success-statistics/run.sh b/tools/jenkins-success-statistics/run.sh
new file mode 100755
index 0000000..191d6b9
--- /dev/null
+++ b/tools/jenkins-success-statistics/run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+curl -v http://jenkins.mxnet-ci.amazon-ml.com/blue/rest/organizations/jenkins/pipelines/incubator-mxnet/branches/master/runs/ > runs