@unitpad/modules 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,21 @@
1
+ # Shared units for compute. In every session (via `units::systems`), not importable.
2
+ # title: Shared units (compute)
3
+ # description: The floating-point operation and the vCPU
4
+
5
+ # One floating-point operation, for compute budgets (`2 TFLOP/s`, `1 teraflop`).
6
+ # No `flops` alias: FLOPS usually means FLOP per second, so write `FLOP/s`.
7
+ dimension FloatingPointOperation
8
+
9
+ @name("Floating-point operation")
10
+ @url("https://en.wikipedia.org/wiki/FLOPS")
11
+ @metric_prefixes
12
+ @aliases(FLOP: short, flop)
13
+ unit FLOP: FloatingPointOperation
14
+
15
+ # A vCPU is a separate count dimension so per-vCPU prices can be scaled by a
16
+ # typed vCPU count instead of an untyped scalar.
17
+ dimension Vcpu
18
+
19
+ @name("vCPU")
20
+ @aliases(vcpus)
21
+ unit vcpu: Vcpu
@@ -0,0 +1,11 @@
1
+ # Shared units for the network. In every session (via `units::systems`), not importable.
2
+ # title: Shared units (network)
3
+ # description: The packet
4
+
5
+ # One packet on the network; instance and NIC limits are quoted in packets/s
6
+ dimension Packet
7
+
8
+ @name("Packet")
9
+ @url("https://en.wikipedia.org/wiki/Network_packet")
10
+ @aliases(pkt, pkts, packets)
11
+ unit packet: Packet
@@ -0,0 +1,21 @@
1
+ # Shared units for disk and volume I/O. In every session (via `units::systems`), not importable.
2
+ # title: Shared units (storage)
3
+ # description: The I/O operation and IOPS
4
+
5
+ # One read or write a disk or volume serves. Its own dimension, not `operation`:
6
+ # Numbat shows a value in the one unit defined as exactly its unit, so if `IOPS`
7
+ # were `operation/s`, every operation rate (Redis, SQL) would print as IOPS.
8
+ # Relate the two with an explicit ratio (`io_per_op = 2 io/operation`).
9
+ dimension IoOperation
10
+
11
+ @name("I/O operation")
12
+ @url("https://en.wikipedia.org/wiki/IOPS")
13
+ @aliases(ios)
14
+ unit io: IoOperation
15
+
16
+ # I/O operations per second, as disks and volumes are rated (`500 kIOPS`)
17
+ @name("I/O operations per second")
18
+ @url("https://en.wikipedia.org/wiki/IOPS")
19
+ @metric_prefixes
20
+ @aliases(IOPS: short, iops)
21
+ unit IOPS: IoOperation / Time = io / second
@@ -0,0 +1,51 @@
1
+ # Shared count units for the workload a system is given: what it receives, handles and keeps. In every session (via `units::systems`), not importable.
2
+ # title: Shared units (workload)
3
+ # description: Count units for events, operations, requests, messages, rows and records
4
+
5
+ # Count units. Each is its own base dimension, so rates in different entities do
6
+ # NOT mix: `message/s` and `record/s` are different dimensions, and converting
7
+ # between them needs an explicit ratio (e.g. `records_per_message = 10 record/message`).
8
+ # Rates are written `<unit>/s` — `50_000 operation/s`, `500 message/s`.
9
+ # Laid out like Numbat's own `units::placeholder`: a named dimension, then its unit.
10
+
11
+ # Something that happened, as logged or emitted
12
+ dimension Event
13
+
14
+ @name("Event")
15
+ @aliases(evt, events)
16
+ unit event: Event
17
+
18
+ # One call against a backend: a cache get, a query, a queue send
19
+ dimension Operation
20
+
21
+ @name("Operation")
22
+ @aliases(op, ops, operations)
23
+ unit operation: Operation
24
+
25
+ # One call a client makes to a service
26
+ dimension Request
27
+
28
+ @name("Request")
29
+ @aliases(req, reqs, requests)
30
+ unit request: Request
31
+
32
+ # One message on a queue or stream
33
+ dimension Message
34
+
35
+ @name("Message")
36
+ @aliases(msg, msgs, messages)
37
+ unit message: Message
38
+
39
+ # One row in a table
40
+ dimension Row
41
+
42
+ @name("Row")
43
+ @aliases(rows)
44
+ unit row: Row
45
+
46
+ # One record in a log, a file or a stream
47
+ dimension Record
48
+
49
+ @name("Record")
50
+ @aliases(rec, recs, records)
51
+ unit record: Record
@@ -0,0 +1,13 @@
1
+ # The units of system design, and the currencies: what every UnitPad sheet starts with (named in `unitpad.json`).
2
+ # In the Numbat command line, `use units::systems` in your `init.nbt` brings them in. One `use` per line, in order; a module
3
+ # may rely on any module listed above it.
4
+
5
+ # Currency is Numbat's: its `USD` and the other currencies, priced by the exchange rates UnitPad feeds it.
6
+ use units::currencies
7
+
8
+ # Count units, each its own dimension, by kind of thing counted.
9
+ use units::systems::workload
10
+ use units::systems::storage
11
+ use units::systems::network
12
+ use units::systems::compute
13
+ use units::systems::aws
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@unitpad/modules",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "The numbers UnitPad sheets import with `use`: latencies, throughputs, sizes, prices and limits, each with its source.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "modules",
9
+ "unitpad.json"
10
+ ],
11
+ "exports": {
12
+ "./package.json": "./package.json",
13
+ "./unitpad.json": "./unitpad.json",
14
+ "./modules/*": "./modules/*"
15
+ },
16
+ "keywords": [
17
+ "unitpad",
18
+ "numbat",
19
+ "units",
20
+ "latency",
21
+ "throughput",
22
+ "capacity-planning"
23
+ ],
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/UnitPad/modules.git"
27
+ },
28
+ "homepage": "https://github.com/UnitPad/modules#readme",
29
+ "bugs": {
30
+ "url": "https://github.com/UnitPad/modules/issues"
31
+ },
32
+ "sideEffects": false,
33
+ "publishConfig": {
34
+ "access": "public",
35
+ "provenance": true
36
+ },
37
+ "scripts": {
38
+ "test": "node --test tools/*.test.mjs",
39
+ "lint": "eslint .",
40
+ "lint:md": "markdownlint-cli2",
41
+ "format": "prettier --write .",
42
+ "format:check": "prettier --check .",
43
+ "api": "node tools/api.mjs",
44
+ "api:update": "node tools/api.mjs --update",
45
+ "api:release": "node tools/api.mjs --release",
46
+ "values": "node tools/values.mjs",
47
+ "values:update": "node tools/values.mjs --update",
48
+ "values:release": "node tools/values.mjs --release",
49
+ "numbat": "node tools/install-numbat.mjs",
50
+ "check": "npm run lint && npm run lint:md && npm run format:check && npm test && node tools/check-docs.mjs && node tools/style.mjs && node tools/api.mjs && node tools/values.mjs && node tools/pack-check.mjs",
51
+ "check:docs": "node tools/check-docs.mjs",
52
+ "style": "node tools/style.mjs",
53
+ "check:pack": "node tools/pack-check.mjs",
54
+ "stale": "node tools/stale.mjs",
55
+ "links": "node tools/links.mjs"
56
+ },
57
+ "devDependencies": {
58
+ "@eslint/js": "^10.0.1",
59
+ "eslint": "^10.12.0",
60
+ "globals": "^17.13.0",
61
+ "markdownlint-cli2": "^0.23.3",
62
+ "prettier": "^3.9.9"
63
+ }
64
+ }
package/unitpad.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "$comment": "What UnitPad reads from this package. `format`: the version of this file's own shape; it only grows (a new field is optional), and a package whose format UnitPad does not know is refused at build, not at run. `prelude`: the modules every sheet starts with (a module made of `use` lines is expanded, so one id can stand for many); they are not importable and not listed in the Modules menu. `types`: a module's type is the first part of its path (`throughput::s3` is a `throughput`); the Modules menu lists the types in this order, under these headings, and a type not listed follows, alphabetically, under its name with a capital.",
3
+ "format": 1,
4
+ "prelude": ["units::systems"],
5
+ "types": [
6
+ {
7
+ "id": "latency",
8
+ "title": "Latency"
9
+ },
10
+ {
11
+ "id": "throughput",
12
+ "title": "Throughput"
13
+ },
14
+ {
15
+ "id": "size",
16
+ "title": "Size"
17
+ },
18
+ {
19
+ "id": "count",
20
+ "title": "Count"
21
+ },
22
+ {
23
+ "id": "capacity",
24
+ "title": "Capacity"
25
+ },
26
+ {
27
+ "id": "availability",
28
+ "title": "Availability"
29
+ },
30
+ {
31
+ "id": "cost",
32
+ "title": "Cost"
33
+ }
34
+ ]
35
+ }