Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isaqueveras/outis
🥊 A simple and zero-dependencies library to create and manage routines, schedule execution time, and control competition between other processes.
https://github.com/isaqueveras/outis
goroutine metrics outis
Last synced: about 1 month ago
JSON representation
🥊 A simple and zero-dependencies library to create and manage routines, schedule execution time, and control competition between other processes.
- Host: GitHub
- URL: https://github.com/isaqueveras/outis
- Owner: isaqueveras
- License: mit
- Created: 2024-03-06T01:09:01.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-13T16:40:13.000Z (about 2 months ago)
- Last Synced: 2024-11-13T17:35:35.566Z (about 2 months ago)
- Topics: goroutine, metrics, outis
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A documentation for the Outis library
The outis library helps you create and manage routines,
schedule execution time, and control competition between other processes.---
## How to use.
```go
package mainimport (
"time""github.com/isaqueveras/outis"
)func main() {
// Initialize Outis to be able to add routines
watch := outis.Watcher("35d3965c8783", "v1/example",
outis.WithLogger(nil), // Option to implement logs interface
outis.WithOutisInterface(nil), // Option to implement outis interface
)watch.Go(
// Routine identifier to perform concurrency control
outis.WithID("8cf7e174fb4f"),outis.WithName("Here is the name of my routine"),
outis.WithDesc("Here is the description of my routine"),// It will run every 10 second
outis.WithInterval(time.Second * 10),// It will run from 12pm to 4pm.
// by default, there are no time restrictions.
outis.WithHours(12, 16),// Time when routine information will be updated
outis.WithLoadInterval(time.Second * 30),// Here the script function that will be executed will be passed
outis.WithScript(func(ctx *outis.Context) {
ctx.Info("this is an information message")
ctx.Error("error: %v", errors.New("this is an error message"))ctx.Metric("client_ids", []int64{234234})
ctx.Metric("notification", outis.Metric{
"client_id": 234234,
"message": "Hi, we are notifying you.",
"fcm": "3p2okrmionfiun2uni3nfin2i3f",
})ctx.Debug("Hello")
}),
)// Method that maintains routine in the process
watch.Wait()
}
```## Reporting issues
The issue tracker for this project [is located here](https://github.com/isaqueveras/outis/issues).
Please report any issues with a sufficient description of the bug or feature request. Ideally, bug reports should be accompanied by a minimal reproduction of the issue.
Bug reports must specify the [version](https://github.com/isaqueveras/outis/releases).## Contributing
This project is open-source and accepts contributions. See the [contribution guide](https://github.com/isaqueveras/outis/blob/main/CONTRIBUTING.md) for more information.