diff --git a/.img/logo.svg b/.img/logo.svg index e04f81d..10f6970 100644 --- a/.img/logo.svg +++ b/.img/logo.svg @@ -1,12 +1,31 @@ - - - - - - - - - - - - + + logo-svg + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index ea300a4..56d6d77 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ -iroh +time-trace -# 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) diff --git a/doc/.keep b/doc/TQL/.keep similarity index 100% rename from doc/.keep rename to doc/TQL/.keep diff --git a/doc/config/.keep b/doc/config/.keep new file mode 100644 index 0000000..e69de29 diff --git a/doc/main.md b/doc/main.md new file mode 100644 index 0000000..9268806 --- /dev/null +++ b/doc/main.md @@ -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). \ No newline at end of file diff --git a/doc/model/model.md b/doc/model/model.md new file mode 100644 index 0000000..12e3fa0 --- /dev/null +++ b/doc/model/model.md @@ -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] +``` diff --git a/doc/usage/.keep b/doc/usage/.keep new file mode 100644 index 0000000..e69de29