diagnosticism 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHORS.md +21 -0
- data/CHANGES.md +45 -0
- data/CONTRIBUTING.md +36 -0
- data/EXAMPLES.md +8 -0
- data/FAQ.md +28 -0
- data/INSTALL.md +41 -0
- data/LICENSE +2 -4
- data/NEWS.md +13 -0
- data/README.md +68 -20
- data/Rakefile +6 -4
- data/SECURITY.md +23 -0
- data/TODO.md +24 -0
- data/examples/doomgram.md +63 -0
- data/examples/doomgram.rb +30 -0
- data/lib/diagnosticism/doomgram.rb +2 -1
- data/lib/diagnosticism/version.rb +5 -5
- metadata +34 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79e784db67f0bf016a4a8848c299434c23a2d24455cc0afb0b7db3a70ca55a22
|
|
4
|
+
data.tar.gz: a50ec32718d58ddc336aef08044e3201608b691c86a02479b9055d88cb7eaa12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d9242824fab8d52729ac2ffb16afca1256ac184c981a2e42abe4a09a012e556ba3d1a5a781c216c0ca44f4545346dca6b509936fd70ae2e51421c1ca64fc72f
|
|
7
|
+
data.tar.gz: 5eb3cf6ce5df7c915d53f5c651c010150b0c2e01ce0944433ec96b9e91a3647fe83a3c5da374712912b7bac8a2aba5a810778eaf1cb26909b2fabd2cf8755d7a
|
data/AUTHORS.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Authors <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Major Contributors
|
|
5
|
+
|
|
6
|
+
| Name | GitHub |
|
|
7
|
+
| ----------- | --------------------------------- |
|
|
8
|
+
| Matt Wilson | [mwsis](https://github.com/mwsis) |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Defect reports, fixes and suggestions (for which we are very grateful)
|
|
12
|
+
|
|
13
|
+
| Name | GitHub |
|
|
14
|
+
| ----------- | --------------------------------- |
|
|
15
|
+
| \<none> | |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Contributions are welcomed.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<!-- ########################### end of file ########################### -->
|
data/CHANGES.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Changes <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## 0.1.4 - 20th August 2026
|
|
5
|
+
|
|
6
|
+
* library source **Home:** URLs now use `https`;
|
|
7
|
+
* renamed **Diagnosticism.Ruby.gemspec** to **diagnosticism.gemspec** so the filename stem matches `spec.name`;
|
|
8
|
+
* **diagnosticism.gemspec**: `required_ruby_version` is the range `>= 2.0`; **Gemfile.lock** and **.ruby-version** excluded from `spec.files`; `spec.summary` matches the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, **TODO**;
|
|
9
|
+
* **Gemfile** sets `lockfile false` when Bundler supports it; stop tracking **Gemfile.lock**;
|
|
10
|
+
* CI uses `bundler-cache: false` and explicit `bundle install`; **Warnings** job on Ruby **3.4**; `gem build diagnosticism.gemspec`;
|
|
11
|
+
* updated **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts) to skip **tput** when **$TERM** is unset or stdout is not a TTY;
|
|
12
|
+
* **README.md**: tagline before badges; TOC before Introduction; Dependencies (Efferent / Afferent); related projects;
|
|
13
|
+
* added **examples/doomgram** and catalogued it in **EXAMPLES.md**;
|
|
14
|
+
* normalised **NEWS.md** version rows to **Diagnosticism.Ruby**;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 0.1.3 - 15th August 2026
|
|
18
|
+
|
|
19
|
+
* added `# frozen_string_literal: true` to all **lib/** sources;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 0.1.2 - 29th August 2025
|
|
23
|
+
|
|
24
|
+
* GitHub Actions;
|
|
25
|
+
* **Rakefile**;
|
|
26
|
+
* boilerplate;
|
|
27
|
+
* updated **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts);
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 0.1.1 - 6th March 2025
|
|
31
|
+
|
|
32
|
+
* warnings;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## 0.1.0 - 9th January 2025
|
|
36
|
+
|
|
37
|
+
* added `DOOMGram` class;
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## 0.0.0 - 2nd January 2025
|
|
41
|
+
|
|
42
|
+
* initial commit;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
<!-- ########################### end of file ########################### -->
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Contributing <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Defects and features](#defects-and-features)
|
|
7
|
+
- [Pull requests](#pull-requests)
|
|
8
|
+
- [Tests](#tests)
|
|
9
|
+
- [License](#license)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Defects and features
|
|
13
|
+
|
|
14
|
+
Open an issue on https://github.com/synesissoftware/Diagnosticism.Ruby/issues.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Pull requests
|
|
18
|
+
|
|
19
|
+
Pull requests are welcome on https://github.com/synesissoftware/Diagnosticism.Ruby. Keep diffs local to the change; match existing indentation (2 spaces in Ruby) and the Synesis markdown set (**README.md**, **CHANGES.md**, **NEWS.md**, **TODO.md**, **INSTALL.md**, **CONTRIBUTING.md**, **SECURITY.md**).
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Tests
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
bundle exec rake test
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
or `./run_all_unit_tests.sh`.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
Contributions are accepted under the 3-clause BSD license. See [LICENSE](./LICENSE).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<!-- ########################### end of file ########################### -->
|
data/EXAMPLES.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Examples <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|Name|Source & Description|Summary|
|
|
4
|
+
|---|---|---|
|
|
5
|
+
|**doomgram**|[examples/doomgram.rb](./examples/doomgram.rb)<br/>[examples/doomgram.md](./examples/doomgram.md)|Simple example illustrating ``DOOMGram`` timing buckets and ``to_strip``|
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<!-- ########################### end of file ########################### -->
|
data/FAQ.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - FAQ <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
The FAQ list is under (constant) development. If you post a question on the
|
|
4
|
+
[Issues](https://github.com/synesissoftware/Diagnosticism.Ruby/issues) forum
|
|
5
|
+
it will be used to create one.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Table of Contents <!-- omit in toc -->
|
|
9
|
+
|
|
10
|
+
- [Q1: "How do I install this library?"](#q1-how-do-i-install-this-library)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# FAQs: <!-- omit in toc -->
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Q1: "How do I install this library?"
|
|
17
|
+
|
|
18
|
+
Install via **gem**:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
gem install diagnosticism
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See [README.md](./README.md) for usage.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<!-- ########################### end of file ########################### -->
|
data/INSTALL.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Installation and Use <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Install the gem](#install-the-gem)
|
|
7
|
+
- [From a source checkout](#from-a-source-checkout)
|
|
8
|
+
- [Using the library](#using-the-library)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Install the gem
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
gem install diagnosticism
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
or add to a **Gemfile**:
|
|
18
|
+
|
|
19
|
+
```Ruby
|
|
20
|
+
gem 'diagnosticism'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
then `bundle install`.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## From a source checkout
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
bundle install
|
|
30
|
+
bundle exec rake test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Using the library
|
|
35
|
+
|
|
36
|
+
```Ruby
|
|
37
|
+
require 'diagnosticism/doomgram'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<!-- ########################### end of file ########################### -->
|
data/LICENSE
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Diagnosticism.Ruby - BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025, Matthew Wilson and Synesis Information Systems
|
|
4
|
-
|
|
3
|
+
Copyright (c) 2025-2026, Matthew Wilson and Synesis Information Systems
|
|
5
4
|
All rights reserved.
|
|
6
5
|
|
|
7
6
|
Redistribution and use in source and binary forms, with or without
|
|
8
|
-
modification, are permitted provided that the following conditions are
|
|
9
|
-
met:
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
10
8
|
|
|
11
9
|
1. Redistributions of source code must retain the above copyright notice,
|
|
12
10
|
this list of conditions and the following disclaimer.
|
data/NEWS.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - News <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
| Date | News Item |
|
|
4
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
5
|
+
| 20th August 2026 | [**Diagnosticism.Ruby** 0.1.4](https://github.com/synesissoftware/Diagnosticism.Ruby/releases/tag/0.1.4) |
|
|
6
|
+
| 15th August 2026 | [**Diagnosticism.Ruby** 0.1.3](https://github.com/synesissoftware/Diagnosticism.Ruby/releases/tag/0.1.3) |
|
|
7
|
+
| 29th August 2025 | [**Diagnosticism.Ruby** 0.1.2](https://github.com/synesissoftware/Diagnosticism.Ruby/releases/tag/0.1.2) |
|
|
8
|
+
| 6th March 2025 | **Diagnosticism.Ruby** 0.1.1 released |
|
|
9
|
+
| 9th January 2025 | [**Diagnosticism.Ruby** 0.1.0](https://github.com/synesissoftware/Diagnosticism.Ruby/releases/tag/0.1.0) |
|
|
10
|
+
| 2nd January 2025 | **Diagnosticism.Ruby** 0.0.0 released |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<!-- ########################### end of file ########################### -->
|
data/README.md
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
# Diagnosticism.Ruby <!-- omit in toc -->
|
|
2
2
|
|
|
3
|
+
Basic diagnostic facilities, for Ruby
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
5
7
|
[](https://badge.fury.io/rb/diagnosticism)
|
|
6
8
|
[](https://github.com/synesissoftware/Diagnosticism.Ruby/commits/master)
|
|
7
9
|
[](https://github.com/synesissoftware/Diagnosticism.Ruby/actions/workflows/ruby.yml)
|
|
8
10
|
|
|
9
|
-
Basic diagnostic facilities, for Ruby
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Introduction
|
|
13
|
-
|
|
14
|
-
**Diagnosticism** provides low-level diagnostics facilities to support library programming. The first **Diagnosticism** library was a C library with a C++ wrapper. There have been several implementations in other languages. **Diagnosticism.Ruby** is the
|
|
15
|
-
Ruby version.
|
|
16
|
-
|
|
17
11
|
|
|
18
12
|
## Table of Contents <!-- omit in toc -->
|
|
19
13
|
|
|
@@ -22,11 +16,23 @@ Ruby version.
|
|
|
22
16
|
- [Components](#components)
|
|
23
17
|
- [Examples](#examples)
|
|
24
18
|
- [Project Information](#project-information)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
- [Where to get help](#where-to-get-help)
|
|
20
|
+
- [Contribution guidelines](#contribution-guidelines)
|
|
21
|
+
- [Dependencies](#dependencies)
|
|
22
|
+
- [Efferent (fan-out)](#efferent-fan-out)
|
|
23
|
+
- [Runtime Dependencies (aka "Normal Dependencies")](#runtime-dependencies-aka-normal-dependencies)
|
|
24
|
+
- [Development Dependencies](#development-dependencies)
|
|
25
|
+
- [Afferent (fan-in)](#afferent-fan-in)
|
|
26
|
+
- [Runtime dependents](#runtime-dependents)
|
|
27
|
+
- [Development dependents](#development-dependents)
|
|
28
|
+
- [Related projects](#related-projects)
|
|
29
|
+
- [License](#license)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Introduction
|
|
33
|
+
|
|
34
|
+
**Diagnosticism** provides low-level diagnostics facilities to support library programming. The first **Diagnosticism** library was a C library with a C++ wrapper. There have been several implementations in other languages. **Diagnosticism.Ruby** is the
|
|
35
|
+
Ruby version.
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
## Installation
|
|
@@ -39,13 +45,25 @@ gem install diagnosticism
|
|
|
39
45
|
|
|
40
46
|
or add it to your `Gemfile`.
|
|
41
47
|
|
|
48
|
+
Use is via specific APIs. For example, in order to use the ``DOOMGram``
|
|
49
|
+
class you would ``require`` the source file, as in:
|
|
50
|
+
|
|
51
|
+
```Ruby
|
|
52
|
+
require 'diagnosticism/doomgram'
|
|
53
|
+
```
|
|
54
|
+
|
|
42
55
|
|
|
43
56
|
## Components
|
|
44
57
|
|
|
58
|
+
The main component of **Diagnosticism.Ruby** today is:
|
|
45
59
|
|
|
60
|
+
* **`Diagnosticism::DOOMGram`** — a **D**ecimal **O**rder-**O**f-**M**agnitude histo**G**ram that records event durations in twelve logarithmic buckets (1ns … 100s+);
|
|
46
61
|
|
|
62
|
+
Require it as `require 'diagnosticism/doomgram'`. Significant facilities include:
|
|
47
63
|
|
|
48
|
-
|
|
64
|
+
* push helpers — `push_event_time_ns`, `push_event_time_us`, `push_event_time_ms`, `push_event_time_s`;
|
|
65
|
+
* aggregate readers — `event_count`, `total_event_time_ns`, `min_event_time_ns`, `max_event_time_ns`, plus per-bucket counts (`num_events_in_1ns` … `num_events_ge_100s`);
|
|
66
|
+
* presentation — `to_strip` (12-character magnitude strip) and `to_s`;
|
|
49
67
|
|
|
50
68
|
|
|
51
69
|
## Examples
|
|
@@ -68,15 +86,46 @@ Defect reports, feature requests, and pull requests are welcome on https://githu
|
|
|
68
86
|
|
|
69
87
|
### Dependencies
|
|
70
88
|
|
|
71
|
-
* [**xqsr3**](https://github.com/synesissoftware/xqsr3/)
|
|
72
89
|
|
|
90
|
+
#### Efferent (fan-out)
|
|
73
91
|
|
|
74
|
-
|
|
92
|
+
Libraries upon which **Diagnosticism.Ruby** depends:
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
##### Runtime Dependencies (aka "Normal Dependencies")
|
|
96
|
+
|
|
97
|
+
* \<none>;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
##### Development Dependencies
|
|
101
|
+
|
|
102
|
+
* [**rake**](https://rubygems.org/gems/rake);
|
|
103
|
+
* [**test-unit**](https://rubygems.org/gems/test-unit);
|
|
104
|
+
* [**xqsr3**](https://github.com/synesissoftware/xqsr3);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
#### Afferent (fan-in)
|
|
108
|
+
|
|
109
|
+
Projects that depend on **Diagnosticism.Ruby**:
|
|
75
110
|
|
|
76
|
-
* [**Diagnosticism**](https://github.com/synesissoftware/Diagnosticism/)
|
|
77
|
-
* [**Diagnosticism.Go**](https://github.com/synesissoftware/Diagnosticism.Go/)
|
|
78
|
-
* [**Diagnosticism.Python**](https://github.com/synesissoftware/Diagnosticism.Python/)
|
|
79
111
|
|
|
112
|
+
##### Runtime dependents
|
|
113
|
+
|
|
114
|
+
* \<none>;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
##### Development dependents
|
|
118
|
+
|
|
119
|
+
* \<none>;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Related projects
|
|
123
|
+
|
|
124
|
+
* [**Diagnosticism**](https://github.com/synesissoftware/Diagnosticism/) — C library with a C++ wrapper;
|
|
125
|
+
* [**Diagnosticism.Go**](https://github.com/synesissoftware/Diagnosticism.Go/);
|
|
126
|
+
* [**Diagnosticism.NET**](https://github.com/synesissoftware/Diagnosticism.NET/);
|
|
127
|
+
* [**Diagnosticism.Python**](https://github.com/synesissoftware/Diagnosticism.Python/);
|
|
128
|
+
* [**Diagnosticism.Rust**](https://github.com/synesissoftware/Diagnosticism.Rust/);
|
|
80
129
|
|
|
81
130
|
|
|
82
131
|
### License
|
|
@@ -85,4 +134,3 @@ Defect reports, feature requests, and pull requests are welcome on https://githu
|
|
|
85
134
|
|
|
86
135
|
|
|
87
136
|
<!-- ########################### end of file ########################### -->
|
|
88
|
-
|
data/Rakefile
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Rakefile for Diagnosticism.Ruby
|
|
2
4
|
|
|
3
5
|
require 'rake/testtask'
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
Rake::TestTask.new do |tt|
|
|
7
9
|
|
|
8
|
-
tt.libs <<
|
|
9
|
-
tt.
|
|
10
|
+
tt.libs << 'lib'
|
|
11
|
+
tt.libs << 'test'
|
|
12
|
+
tt.name = 'test'
|
|
10
13
|
tt.test_files = FileList['test/**/tc_*.rb']
|
|
11
14
|
tt.verbose = true
|
|
12
15
|
end
|
|
@@ -16,4 +19,3 @@ task :default => :test
|
|
|
16
19
|
|
|
17
20
|
|
|
18
21
|
# ############################## end of file ############################# #
|
|
19
|
-
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Security <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Reporting a vulnerability](#reporting-a-vulnerability)
|
|
7
|
+
- [Supported versions](#supported-versions)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Reporting a vulnerability
|
|
11
|
+
|
|
12
|
+
Please report security issues privately via GitHub Security Advisories on https://github.com/synesissoftware/Diagnosticism.Ruby/security, or by opening an issue if an advisory cannot be filed. Do not attach exploit proofs of concept against third-party systems.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Supported versions
|
|
16
|
+
|
|
17
|
+
| Version | Supported |
|
|
18
|
+
| ------- | --------- |
|
|
19
|
+
| 0.1.x | ✅ |
|
|
20
|
+
| < 0.1 | ❌ |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<!-- ########################### end of file ########################### -->
|
data/TODO.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - TODO <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Functional improvements
|
|
5
|
+
|
|
6
|
+
* \<none>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Performance improvements
|
|
10
|
+
|
|
11
|
+
* \<none>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Packaging improvements
|
|
15
|
+
|
|
16
|
+
* [x] ~~~rename gemspec so the filename stem matches `spec.name` (`Diagnosticism.Ruby.gemspec` → **diagnosticism.gemspec**)~~~;
|
|
17
|
+
* [x] ~~~obtain a **run_all_unit_tests.sh** (from **misc-dev-scripts**) that skips `tput` when `$TERM` is unset or stdout is not a TTY (CI: `tput: No value for $TERM and no -T specified`)~~~;
|
|
18
|
+
* [x] ~~~drop gemspec `required_ruby_version` `< 4` upper bound~~~;
|
|
19
|
+
* [x] ~~~gemspec polish: `https` homepage, Rubygems `metadata` URIs, include **CHANGES.md** (and sibling docs) in packaged files~~~;
|
|
20
|
+
* [x] ~~~stop tracking **Gemfile.lock**; **Gemfile** `lockfile false` when Bundler supports it; CI `bundler-cache: false`~~~;
|
|
21
|
+
* [x] ~~~after the packaging/boilerplate/CI baseline: bump **VERSION** and align **CHANGES**/**NEWS**~~~;
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<!-- ########################### end of file ########################### -->
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Diagnosticism.Ruby - Example - **doomgram**
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Simple example illustrating use of the ``DOOMGram`` class: push timings in
|
|
6
|
+
nanoseconds, microseconds, milliseconds, and seconds, then print the
|
|
7
|
+
12-character magnitude strip.
|
|
8
|
+
|
|
9
|
+
## Source
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
|
|
13
|
+
#! /usr/bin/env ruby
|
|
14
|
+
|
|
15
|
+
# examples/doomgram.rb
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
require 'diagnosticism/doomgram'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
include Diagnosticism
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
dg = DOOMGram.new
|
|
25
|
+
|
|
26
|
+
dg.push_event_time_ns 9
|
|
27
|
+
dg.push_event_time_ns 80
|
|
28
|
+
dg.push_event_time_ns 700
|
|
29
|
+
dg.push_event_time_us 6
|
|
30
|
+
dg.push_event_time_us 50
|
|
31
|
+
dg.push_event_time_us 400
|
|
32
|
+
dg.push_event_time_ms 3
|
|
33
|
+
dg.push_event_time_ms 20
|
|
34
|
+
dg.push_event_time_ms 100
|
|
35
|
+
dg.push_event_time_s 9
|
|
36
|
+
dg.push_event_time_s 80
|
|
37
|
+
dg.push_event_time_s 700
|
|
38
|
+
|
|
39
|
+
puts "event_count=#{dg.event_count}"
|
|
40
|
+
puts "min_ns=#{dg.min_event_time_ns} max_ns=#{dg.max_event_time_ns}"
|
|
41
|
+
puts "to_s=#{dg}"
|
|
42
|
+
puts "to_strip(zero='-', range='abcd')=#{dg.to_strip(zero_character: '-', range: 'abcd')}"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Twelve sample events are pushed, one into each order-of-magnitude bucket
|
|
46
|
+
from 1ns through 100s+. ``to_s`` / ``to_strip`` then render a 12-character
|
|
47
|
+
strip whose letters encode the decimal order of the count in each bucket
|
|
48
|
+
(``a`` means 1–9 events). A second strip uses a shorter range and a custom
|
|
49
|
+
zero character.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
When run (with ``lib`` on the load path, or after ``gem install diagnosticism``), this produces the following output:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
event_count=12
|
|
57
|
+
min_ns=9 max_ns=700000000000
|
|
58
|
+
to_s=aaaaaaaaaaaa
|
|
59
|
+
to_strip(zero='-', range='abcd')=aaaaaaaaaaaa
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<!-- ########################### end of file ########################### -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#! /usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# examples/doomgram.rb
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
require 'diagnosticism/doomgram'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
include Diagnosticism
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
dg = DOOMGram.new
|
|
13
|
+
|
|
14
|
+
dg.push_event_time_ns 9
|
|
15
|
+
dg.push_event_time_ns 80
|
|
16
|
+
dg.push_event_time_ns 700
|
|
17
|
+
dg.push_event_time_us 6
|
|
18
|
+
dg.push_event_time_us 50
|
|
19
|
+
dg.push_event_time_us 400
|
|
20
|
+
dg.push_event_time_ms 3
|
|
21
|
+
dg.push_event_time_ms 20
|
|
22
|
+
dg.push_event_time_ms 100
|
|
23
|
+
dg.push_event_time_s 9
|
|
24
|
+
dg.push_event_time_s 80
|
|
25
|
+
dg.push_event_time_s 700
|
|
26
|
+
|
|
27
|
+
puts "event_count=#{dg.event_count}"
|
|
28
|
+
puts "min_ns=#{dg.min_event_time_ns} max_ns=#{dg.max_event_time_ns}"
|
|
29
|
+
puts "to_s=#{dg}"
|
|
30
|
+
puts "to_strip(zero='-', range='abcd')=#{dg.to_strip(zero_character: '-', range: 'abcd')}"
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# ######################################################################## #
|
|
2
3
|
# File: doomgram.rb
|
|
3
4
|
#
|
|
4
5
|
# Purpose: Definition of the `DOOMGram` class.
|
|
5
6
|
#
|
|
6
7
|
# Created: 9th January 2025
|
|
7
|
-
# Updated:
|
|
8
|
+
# Updated: 15th August 2026
|
|
8
9
|
#
|
|
9
10
|
# Author: Matthew Wilson
|
|
10
11
|
#
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
# ######################################################################## #
|
|
3
3
|
# File: lib/diagnosticism/version.rb
|
|
4
4
|
#
|
|
5
5
|
# Purpose: Version for Diagnosticism.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 3rd January 2025
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 20th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/Diagnosticism.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
14
|
-
# Copyright (c) 2025, Matthew Wilson and Synesis Information Systems
|
|
14
|
+
# Copyright (c) 2025-2026, Matthew Wilson and Synesis Information Systems
|
|
15
15
|
# All rights reserved.
|
|
16
16
|
#
|
|
17
17
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
module Diagnosticism
|
|
51
51
|
|
|
52
52
|
# Current version of the Diagnosticism library
|
|
53
|
-
VERSION = '0.1.
|
|
53
|
+
VERSION = '0.1.4'
|
|
54
54
|
|
|
55
55
|
private
|
|
56
56
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
metadata
CHANGED
|
@@ -1,53 +1,70 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diagnosticism
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Wilson
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: xqsr3
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "~>"
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '0.39'
|
|
19
16
|
- - ">="
|
|
20
17
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0.39.
|
|
18
|
+
version: 0.39.5
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '1.0'
|
|
22
22
|
type: :development
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
|
-
- - "~>"
|
|
27
|
-
- !ruby/object:Gem::Version
|
|
28
|
-
version: '0.39'
|
|
29
26
|
- - ">="
|
|
30
27
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: 0.39.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
version: 0.39.5
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '1.0'
|
|
32
|
+
description: |
|
|
33
|
+
Basic diagnostic facilities, for Ruby. Diagnosticism.Ruby provides
|
|
34
|
+
low-level diagnostics components, including a decimal order-of-magnitude
|
|
35
|
+
histogram (DOOMGram) for recording event durations.
|
|
36
|
+
email:
|
|
37
|
+
- matthew@synesis.com.au
|
|
36
38
|
executables: []
|
|
37
39
|
extensions: []
|
|
38
40
|
extra_rdoc_files: []
|
|
39
41
|
files:
|
|
42
|
+
- AUTHORS.md
|
|
43
|
+
- CHANGES.md
|
|
44
|
+
- CONTRIBUTING.md
|
|
45
|
+
- EXAMPLES.md
|
|
46
|
+
- FAQ.md
|
|
47
|
+
- INSTALL.md
|
|
40
48
|
- LICENSE
|
|
49
|
+
- NEWS.md
|
|
41
50
|
- README.md
|
|
42
51
|
- Rakefile
|
|
52
|
+
- SECURITY.md
|
|
53
|
+
- TODO.md
|
|
54
|
+
- examples/doomgram.md
|
|
55
|
+
- examples/doomgram.rb
|
|
43
56
|
- lib/diagnosticism/doomgram.rb
|
|
44
57
|
- lib/diagnosticism/version.rb
|
|
45
58
|
- test/unit/tc_doomgram.rb
|
|
46
59
|
- test/unit/ts_all.rb
|
|
47
|
-
homepage:
|
|
60
|
+
homepage: https://github.com/synesissoftware/Diagnosticism.Ruby
|
|
48
61
|
licenses:
|
|
49
62
|
- BSD-3-Clause
|
|
50
|
-
metadata:
|
|
63
|
+
metadata:
|
|
64
|
+
bug_tracker_uri: https://github.com/synesissoftware/Diagnosticism.Ruby/issues
|
|
65
|
+
changelog_uri: https://github.com/synesissoftware/Diagnosticism.Ruby/blob/master/CHANGES.md
|
|
66
|
+
homepage_uri: https://github.com/synesissoftware/Diagnosticism.Ruby
|
|
67
|
+
source_code_uri: https://github.com/synesissoftware/Diagnosticism.Ruby
|
|
51
68
|
rdoc_options: []
|
|
52
69
|
require_paths:
|
|
53
70
|
- lib
|
|
@@ -56,9 +73,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
56
73
|
- - ">="
|
|
57
74
|
- !ruby/object:Gem::Version
|
|
58
75
|
version: '2.0'
|
|
59
|
-
- - "<"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '4'
|
|
62
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
77
|
requirements:
|
|
64
78
|
- - ">="
|
|
@@ -67,5 +81,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
67
81
|
requirements: []
|
|
68
82
|
rubygems_version: 3.6.9
|
|
69
83
|
specification_version: 4
|
|
70
|
-
summary:
|
|
84
|
+
summary: Basic diagnostic facilities, for Ruby
|
|
71
85
|
test_files: []
|