Commit Graph

137 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski d09e751437 Update how we recommend including the dependency
Since otherwise current users get hit with warnings.
2021-12-17 10:36:44 +09:00
tomer doron 6bc8aa8a06
add docker-compose setup for 5.5 (#104)
motivation: tests on 5.5

changes: add docker compose file for testing on 5.5
2021-12-16 16:38:36 -08:00
tomer doron 495aca6d51
update doc generation script (#103)
motivation: source-kitten has changed how its invoked

changes:
* invoke source-kitten with the correct flags
* make location of source-kitten source checkout more robust
* udpate docker to install jazzy on on focal
2021-12-16 15:17:27 -08:00
Konrad `ktoso` Malawski 992b87907d [SSWG] document release process 2021-08-23 13:10:27 +09:00
Rauhul Varma 3edd2f57af update comment 2021-08-16 11:49:56 +09:00
Rauhul Varma 2c58b010a2 remove assertions 2021-08-16 11:49:56 +09:00
Rauhul Varma 42372a8598 Introduce FloatingPointCounter
motivation: It is not currently possible to record floating point values via the swift-metrics API even if the metrics backend supports it.

modifications: Adds a `FloatingPointCounter` type to allow users to accumulate non-integral metrics backed by a `FloatingPointCounterHandler`. Introduces a default implementation for creating and destroying `FloatingPointCounterHandler`s for metric backends that do not natively support floating point counters. On such backends, `FloatingPointCounter` is backed by a `AccumulatingRoundingFloatingPointCounter` which accumulates floating point values internally and record increments to a wrapped `CounterHandler` after crossing integer boundaries.

result: Users can create `FloatingPointCounter`s to record floating point values and get enhanced behavior for backends that support floating point values.
2021-08-16 11:49:56 +09:00
tomer doron 99a068b962 Update README.md 2021-06-21 11:24:47 +09:00
tomer doron 8ea359b532 Update README.md 2021-06-21 11:24:47 +09:00
tomer doron 2a7fd99ea8 Update README.md 2021-06-21 11:24:47 +09:00
tomer doron 1bb953eb76 Create SECURITY.md 2021-06-21 11:24:47 +09:00
tomer doron e2c4a510b6
update 5.4 to release docker image (#94)
motivation: 5.4 is out!

changes: use release docker images instead of nightly
2021-05-06 18:24:14 -07:00
James Sherlock c6cdc69235
[readme] Add OpenTelemetry to compatible libraries (#93)
Add OpenTelemetry to compatible libraries
2021-04-06 10:35:50 -07:00
tom doron de1a7d570b add docker setup for 5.4 and nightly
motivation: CI for 5.4 and latest

changes: add docker setup files for 5.4 and main nightly images
2021-02-27 10:58:36 +09:00
Yim Lee 923775a5f6
Use welcoming language (#90) 2021-01-22 00:42:50 -08:00
Konrad `ktoso` Malawski 68e6cb2938 Apply suggestions from code review 2020-11-17 10:07:04 +09:00
Konrad `ktoso` Malawski c793c35d07 Apply suggestions from code review
Co-authored-by: Yim Lee <yim_lee@apple.com>
2020-11-17 10:07:04 +09:00
Konrad `ktoso` Malawski 7274cf41ef +readme Cross link to extras 2020-11-17 10:07:04 +09:00
Jari (LotU) e382458581 Remove reader lock 2020-11-12 18:10:16 +09:00
Jari (LotU) 2b6e31e1b3 Expose lock functionality 2020-11-12 18:10:16 +09:00
Konrad `ktoso` Malawski f5ed78cb26 =core remove not used import (Dispatch) 2020-10-13 10:39:24 +09:00
Moritz Lang 44e8bfc7f5
Add Timer.recordInterval method (#83)
* Add Timer.recordInterval method

Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2020-10-12 12:18:21 -07:00
Konrad `ktoso` Malawski 5702ee1174
metrics should include their labels when printed to ease debugging (#82)
motivation: ease debugging

changes: confirm metrics types to CustomStringConvertible
2020-10-08 15:08:43 -07:00
tomer doron cf757fe4eb
remove symbolicate-linux-fatal from Docker (#81)
motivation: we are not actually using symbolicate-linux-fatal in any meaningful way in CI and it's pinned to the master branch which has been removed

changes: remove symbolicate-linux-fatal fetching from Docker
2020-10-07 16:46:50 -07:00
tomer doron 69cc955761 Swift 5.3 was released, use if for CI
motivation: Swift 5.3 was released, use if for CI

changes: update docker setup to use the release version of 5.3
2020-09-20 12:09:04 +09:00
Konrad `ktoso` Malawski b6c9d615de =readme Fix link to point at main branch 2020-09-08 14:56:01 +09:00
Konrad `ktoso` Malawski f46b1894aa Update CONTRIBUTING.md 2020-07-18 12:22:54 +09:00
Konrad `ktoso` Malawski 313c84fdec add sanity.sh info to contributing.md 2020-07-18 12:22:54 +09:00
tomer doron 56ae451f00
improve 5.3 docker setup (#71)
motivation: pin to 5.3 nighties 

changes: use swiftlang/swift:nightly-5.3-master-bionic instead of swiftlang/swift:nightly-master-bionic
2020-05-05 12:00:16 -07:00
tomer doron 41d2db7675
update ci setup (#67)
motivation: 5.2 adoption, prepare for 5.3

changes:
* add 5.2 docker-compose setup
* add 5.3 docker-compose setup (placeholder)
* remove 4.2 docker-compose setup
* format
2020-04-03 19:50:13 -07:00
Johannes Weiss a8db098592
Update README.md (#65) 2020-03-04 08:37:02 -08:00
tomer doron 708b960b46
Add microseconds to TimeUnit (#64)
Motivation:
I have a metrics backend where I need to store timer values in
microseconds. The "preferred display unit" models this exactly, but it
seems to have (inadvertently?) omitted the possibility to express
microseconds. Note that among the timer "report" methods there is
already a microseconds option.

Changes:
* change TimeUnit from enum to struct with static members to support non-api breaking future evolution 
* add scaleFromNanoseconds to TimeUnit to make it easy to compute the values without switching over
* add tests

Co-authored-by: Chris Burrows <cburrows@gmail.com>
2020-03-03 17:51:39 -08:00
tomer doron ab3f3ffe1e
update docs generation script to work better with selinux (#63)
motivation: docs scripts is broken on selinux due to restriction on ssh-agent

changes:
* change the jazzy workspace to a directory accessible by the CI node so we can push from the agent instead of from the docker container
* dont remove older docs when pushing new ones
* add version inforamtion and source links
2020-02-28 12:25:20 -08:00
Christian Priebe 09b72f68ed
Improve precondition error messages in Lock functions (#58)
This commit adds error messages to the precondition checks in Lock functions
that state the action that failed as well as the OS error code.
2020-02-10 11:15:04 -08:00
Christian Priebe f1514a4c74
Bugfix: Print correct error message if bootstrap is called multiple times (#57)
MetricsSystem.bootstrap verifies that the metric system has not been previously
initialized. Otherwise it should fail with a corresponding error message. The
precondition error message includes the name of the currently used factory and
for that accesses self.factory. However, because bootstrap already holds
self.lock as a writer lock, self.factory fails to get it as a reader and
crashes with a less useful precondition error message. This commit ensures that
the correct error message is printed.
2020-02-10 11:11:28 -08:00
Christian Priebe aa197a1c15
Fix typos in test output (#59) 2020-02-10 17:26:55 +00:00
tom doron b2de986030 improve docker security
motivation: more secured ci setup

changes:
* enable :z selinux flag on bind mounts so we can enable selinux on ci
* drop potentially exploitable capabilities from docker-compose
2020-01-30 12:25:55 +09:00
tomer doron 998de4b2cf better format
motivation: adjust format to xcode format

changes:
* update .swiftformat no-indent setting and run formatter
* update test generation script to match correct format
2019-12-18 12:14:01 +09:00
MrLotU 49431459f9 Update Timer.measure() to use DispatchTime instead of Date 2019-11-11 09:39:33 +09:00
tomer doron c471ec9b35
check for api breakage and prepare to test with thread sanitizer in ci (#49)
motivation: better ci testing

changes:
* add api breakage script to test api breakage in ci
* add "shell" utility docker-compose task to run api breakage script
* change test task to treat warning as errors
* prepare to test with thread sanitizer in 5.1
2019-11-04 16:43:49 -08:00
tomer doron 18d9833602 swift 5.1 docker setup
motivation: support swift 5.1

changes:
* add docker compose file for swift 5.1, will add CI job once merged
* update swiftformat version to 0.40.12
2019-09-24 12:41:39 +09:00
tomer doron 9c047ec865 list StatsD Client 2019-09-19 11:13:06 +09:00
Jari (LotU) 3fefedaaef TimeUnits (#42)
motivation: some metrics backend prefer to be given a hint about the preferred display unit (seconds, milliseconds, etc) to drive the ux 

changes: add a `preferedUnit` to TimerHandler (and `TimeUnits`) to capture the prefer display unit
2019-09-09 09:53:03 -07:00
tomer doron 853893bbf2 update conduct email address
motivation: use correct email address for conduct issues

changes: make sure email address is `swift-server-conduct@group.apple.com` everywhere
2019-09-07 11:35:23 +09:00
tomer doron 41b382a88d update conduct email group (#41)
motivation: use consistent email across swift server projects

changes: set conduct email address to swift-server-conduct@group.apple.com
2019-08-20 20:59:28 +01:00
Konrad `ktoso` Malawski e0ec4aea36 define record() more explicitly that it is a "set the value" (#35)
motivation: define record() more explicitly that it is a "set the value" operation as it seemed to be confusing when implementing or using the API.

changes: update API docs accordingly
2019-07-30 14:55:38 -07:00
tomer doron 25c2c17b45 test formatting issues as part of sanity check
motivaiton: unified format

changes:
* use official docker image 🎉
* fix outstanding formatting issues
* add a call to swiftformat as part of sanity script
* fix sanity script language check debugging statements
2019-07-30 14:10:30 +09:00
Joe Smith d9b74611a7 README updates (#37)
📖 Small corrections, updates to the latest API, and grammar tweaks.

Motivation:

Make sure our README is current and easy to follow.

Modifications:

Graphite is a backend for metrics, Grafana is a frontend for visualization+alerting that can be powered by many backends.
We have a tagged release.
Add a link to @MrLotU 's SwiftPrometheus (emoji optional 😄 )
Some (mostly optional) punctuation tweaks
Tried to re-word the "applications choose their backend" section so it does not use the passive voice.
Update to the latest API... do we still want to write this out this here vs. link to the auto-generated API docs? 🤔 I'm leaning toward deleting it, but there's some value in it all being present here so long as we remember to update it.
Result:

Ideally, a better README! 📖
2019-07-12 15:56:38 -07:00
Konrad `ktoso` Malawski c7bbb2c55f Docs #26 shuffle around definitions to show user API first (#31) 2019-07-09 16:43:48 +01:00
Nathan Harris 8e5110dcd6 Add `Timer.recordNanoseconds` Generic Overload (#28) (#30)
Motivation:

As discussed in Issue #28, there are a few preferred lightweight APIs for getting timestamps such as `DispatchTime` but those APIs return `UInt64` types, which need to be handled for overflow.

Modifications:

Added a generic `BinaryInteger` overload method for `recordNanoseconds` that guards against accidental overflows from `UInt64` to `Int64`

Result:

Users now have access to a new method to record nanosecond measurements with `Timer` that guards against overflows.
2019-05-25 21:36:56 -07:00