monotonic_tick_count 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.jenkins/Jenkinsfile +51 -0
- data/.jenkins/ruby_build_pod.yml +19 -0
- data/CHANGELOG.md +22 -0
- data/Gemfile +2 -1
- data/README.md +1 -1
- data/lib/monotonic_tick_count.rb +3 -3
- data/lib/monotonic_tick_count/version.rb +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8959e6880634a46051dd28e4d93f8b8a3d5c4550bda0418b295fa74dd8607f93
|
4
|
+
data.tar.gz: 60b61d19511e6aa03ba207256c090d0a01e930d1ec947a20a123ed1a8aaf5153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 592c767309c9c8930e5aab010456da3e4e8b15e30b993123661dcd8edefcbb27ae1fc8eff4fec0f5474aca6ecc9cc5446f492f1fe33c6fda87f47168ac4a7da0
|
7
|
+
data.tar.gz: b8674d845f67025e476abddff9109331dfa0816e28be328afe545f303260aeb1aebaca0990857cabf9fe1aba2305e9db03e6d7cbf8788789503a07d8a51e2988
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/groovy
|
2
|
+
@Library('jenkins-pipeline@v0.4.5')
|
3
|
+
import com.invoca.docker.*;
|
4
|
+
pipeline {
|
5
|
+
agent {
|
6
|
+
kubernetes {
|
7
|
+
defaultContainer "ruby"
|
8
|
+
yamlFile ".jenkins/ruby_build_pod.yml"
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
environment {
|
13
|
+
GITHUB_TOKEN = credentials('github_token')
|
14
|
+
BUNDLE_GEM__FURY__IO = credentials('gemfury_deploy_token')
|
15
|
+
}
|
16
|
+
|
17
|
+
stages {
|
18
|
+
stage('Setup') {
|
19
|
+
steps {
|
20
|
+
updateGitHubStatus('clean-build', 'pending', 'Unit tests.')
|
21
|
+
script {
|
22
|
+
sh 'bundle install'
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
stage('Unit Test') {
|
27
|
+
steps {
|
28
|
+
script {
|
29
|
+
sh 'bundle exec rspec --format RspecJunitFormatter --out spec/reports/rspec.xml'
|
30
|
+
}
|
31
|
+
}
|
32
|
+
post {
|
33
|
+
always { junit '*/reports/*.xml' }
|
34
|
+
success { updateGitHubStatus('clean-build', 'success', 'Unit tests.') }
|
35
|
+
failure { updateGitHubStatus('clean-build', 'failure', 'Unit tests.') }
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
void updateGitHubStatus(String context, String status, String description) {
|
42
|
+
gitHubStatus([
|
43
|
+
repoSlug: 'Invoca/monotonic_tick_count',
|
44
|
+
sha: env.GIT_COMMIT,
|
45
|
+
description: description,
|
46
|
+
context: context,
|
47
|
+
targetURL: env.BUILD_URL,
|
48
|
+
token: env.GITHUB_TOKEN,
|
49
|
+
status: status
|
50
|
+
])
|
51
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
apiVersion: v1
|
3
|
+
kind: Pod
|
4
|
+
metadata:
|
5
|
+
labels:
|
6
|
+
jenkins/monotonic-tick_count: 'true'
|
7
|
+
namespace: jenkins
|
8
|
+
name: monotonic-tick_count
|
9
|
+
spec:
|
10
|
+
containers:
|
11
|
+
- name: ruby
|
12
|
+
image: ruby:2.6.5
|
13
|
+
tty: true
|
14
|
+
resources:
|
15
|
+
requests:
|
16
|
+
memory: "100Mi"
|
17
|
+
command:
|
18
|
+
- cat
|
19
|
+
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [0.2.1] - 2020-07-09
|
10
|
+
### Changed
|
11
|
+
- MonotonicTickCount#timer: yield start_tick to block
|
12
|
+
|
13
|
+
## [0.2.0] - 2020-04-21
|
14
|
+
### Added
|
15
|
+
- jenkins pipeline
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
- prepared for initial release
|
19
|
+
|
20
|
+
[Unreleased]: https://github.com/Invoca/monotonic_tick_count/compare/v0.2.1...HEAD
|
21
|
+
[0.2.1]: https://github.com/Invoca/monotonic_tick_count/releases/tag/v0.2.0...v0.2.1
|
22
|
+
[0.2.0]: https://github.com/Invoca/monotonic_tick_count/releases/tag/v0.2.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/lib/monotonic_tick_count.rb
CHANGED
@@ -62,9 +62,9 @@ class MonotonicTickCount
|
|
62
62
|
|
63
63
|
# yields to the caller and returns a pair: [result from yield, float time in seconds of block run]
|
64
64
|
def timer
|
65
|
-
|
66
|
-
result = yield
|
67
|
-
[result, self.now -
|
65
|
+
start_tick = self.now
|
66
|
+
result = yield(start_tick)
|
67
|
+
[result, self.now - start_tick]
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monotonic_tick_count
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Kelley
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -32,8 +32,11 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- ".gitignore"
|
35
|
+
- ".jenkins/Jenkinsfile"
|
36
|
+
- ".jenkins/ruby_build_pod.yml"
|
35
37
|
- ".rubocop.yml"
|
36
38
|
- ".travis.yml"
|
39
|
+
- CHANGELOG.md
|
37
40
|
- Gemfile
|
38
41
|
- LICENSE.txt
|
39
42
|
- README.md
|
@@ -48,7 +51,7 @@ licenses:
|
|
48
51
|
- MIT
|
49
52
|
metadata:
|
50
53
|
allowed_push_host: https://rubygems.org
|
51
|
-
post_install_message:
|
54
|
+
post_install_message:
|
52
55
|
rdoc_options: []
|
53
56
|
require_paths:
|
54
57
|
- lib
|
@@ -63,9 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
66
|
- !ruby/object:Gem::Version
|
64
67
|
version: '0'
|
65
68
|
requirements: []
|
66
|
-
|
67
|
-
|
68
|
-
signing_key:
|
69
|
+
rubygems_version: 3.0.1
|
70
|
+
signing_key:
|
69
71
|
specification_version: 4
|
70
72
|
summary: PORO to hold a monotonic tick count. Useful for measuring time differences.
|
71
73
|
test_files: []
|