This repository has been archived by the owner on Sep 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): data structure and example
- Loading branch information
Showing
7 changed files
with
127 additions
and
19 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<img alt="iroh" src="./.img/logo.svg" width="150" /> | ||
<img alt="time-trace" src="./.img/logo.svg" width="150" /> | ||
|
||
# Time Trace | ||
## TimeTrace | ||
|
||
Time trace is an In memory event or log, storage and stream platform. | ||
Which you can use to store and stream your service logs, events and ... | ||
Some of use cases of ttrace is storing and streaming price and other stuff in fintech services, storing IoT projects events (events from different devices) and also your project logs. | ||
[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/EvYB9ZgYvV) | ||
|
||
# Full Documentation | ||
> SOON | ||
Time-trace is a software which allow you to store and stream your service logs, events and ..., in real-time. | ||
When you are using time-trace you are using a completely new data structure and model which is strongly mixed with time. | ||
|
||
|
||
### DOCs | ||
|
||
[Documentation](./doc/main.md) |
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Time Trace Documentation | ||
|
||
Time-trace is a software which allow you to store and stream your service logs, events and ..., in real-time. | ||
When you are using time-trace you are using a completely new data structure and model which is strongly mixed with time. | ||
|
||
In this documentation we have different parts: | ||
|
||
* [model](./model/) (which is talk about data structure of time-trace and also some use case examples). | ||
* [config](./config/) (which is show you how config works in time-trace). | ||
* [TQL](./TQL/) (time query language). | ||
* [usage](./usage/) (which is show how can you use time-trace in action). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Model | ||
|
||
In time-trace data model we have 3 main concepts, Sets, Sub-sets ans Elements. The first important thing you should consider when read this document is to don't confuse this with sets in math, they are similar and have same name, but not completely same. | ||
|
||
## Element | ||
|
||
Elements in time-trace is name of each separated data we are save and stream. each element has 2 field, value and time. | ||
|
||
Something like this: | ||
``` | ||
[value, time] | ||
``` | ||
|
||
And this is how they look likes in code: | ||
```go | ||
type Element struct { | ||
value string | ||
time time.Time | ||
} | ||
``` | ||
|
||
## Sub-Set | ||
|
||
Sub-sets is a set of Elements in a array. we can have similar elements (similar value) in same sub-set. | ||
|
||
Something like this: | ||
``` | ||
[someDate, time-1] | ||
[anotherData, time-2] | ||
[someData, time-3] | ||
[firstValue, time-4] | ||
[secondValue, time-5] | ||
[aValue, time-6] | ||
[aValue, time-7] | ||
``` | ||
|
||
And this is how it look likes in code: | ||
```go | ||
type SubSet []Element | ||
``` | ||
|
||
## Set | ||
|
||
Sets is a map of string to sub-sets, the string is name of each sub-set (each set itself has a name). | ||
|
||
Something like this: | ||
``` | ||
Set[goldPrice]: | ||
sub-set[AUD] # GOLD/AUD price | ||
sub-set[USD] # GOLD/USD price | ||
``` | ||
|
||
And this is how it look likes in code: | ||
```go | ||
type Sets map[string]Set | ||
type Set map[string]SubSet | ||
``` | ||
|
||
## Examples | ||
|
||
Before starting you can check [types](../../core/database/types.go) to understand the main 3 concepts better if you wish. | ||
|
||
Now we are going to show an example of how it works. our example is for a fintech service for store and stream prices. | ||
(other use cases of time-trace can be IoT, multiplayer games and saving services logs, but we are going to explain it with an fintech example). | ||
|
||
In this example our service going to show and store prices of gold (and other stuff). so, we can start by making our database and name it `price-service` in config. | ||
Then we make a Set and assign `GOLD` name to it. each sub set of this set is name of one currency, like AUD, EUR, USD and ... | ||
Each element of each sub-set is the live price of GOLD/SUB-SET-NAME-CURRENCY in value, and the default time. | ||
|
||
Like: | ||
``` | ||
Set: GOLD | ||
Sub-set: USD | ||
Element example: ["1,970.30", 1698228966] | ||
``` |
Empty file.