GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - spannercodes/strata: tree-based time-period tracking

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
strata.py
strata.py
 
 

Repository files navigation

Strata

Tree-based time-period tracking


Specification

Datastricture

The datastructure is, at a given moment in time, a stack, but overall is a tree. Its elements are periods.
A period consists of a start timestamp, an optional (i.e. unset until applicable) end timestamp, and a list of child periods.
A period's bounds (start & end) MUST NOT exceed the bounds of its parent period.
A period's bounds MUST NOT overlap with the bounds of its siblings (the start/end times MAY be equal).

The result is something similar to the way a flamegraph is constructed.

The operations performed on the stack/tree are:

  • push (creates a child period to the current deepest active period)
  • pop (ends the current deepest period)
  • popandpush (ends the current deepest period and pushes a new period, a sibling to the period that was ended)

Periods have a url-safe string identifier, which is used for representing the current period stack (or any period stack).

An example of a stack represented as a string: tournament/race-1/lap-1 for a tree like:

tournament/
	race-1/
		lap-1
		lap-2
		lap-3
	race-2/
		lap-1

or, for the current stack in this tree: tournament/race-2/lap-1

Reading

The information for a period is accessed over HTTP and returned in JSON.

For example:

GET /tournament/race-1/lap-1 returns

{
	"start": 1785172958,
	"end": null,
	"children": []
}

Or for its parent:

GET /tournament/race-1 returns

{
	"start": 1785172958,
	"end": null,
	"children": ["lap-1"]
}

Writing

Operating on the current stack is done using PUT and DELETE requests.

For example, given a beginning stack of tournament/:

PUT /tournament/race-1 -- Pushes the child period
PUT /tournament/race-1/lap-1 -- Same as above
PUT /tournament/race-1/lap-2 -- Since the current state is /tournament/race-1/lap-1, this pops & pushes the new period
DELETE /tournament/race-1 -- Pops the race period. The stack is back to its beginning state, but with child nodes finished

About

tree-based time-period tracking

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.