Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ vita: our %radio has 326 subs

to unregister a desk: `:vita|d %kids`. WARNING: all data collected on an unregistered desk will be lost.

once every 24 hours, `:vita` grabs downloads metrics on each registered desk using `.^((set ship) %cs /=mydesk=/subs)`. every time this scry is performed, `:vita` logs the size of the set with a timestamp. `:vita` keeps one copy of the latest full set of downloaders, and a cumulative set of all unique downloaders.
once every 24 hours, `:vita` grabs downloads metrics on each registered desk using `.^((set [@p rave:clay]) %cx /=//=/cult/mydesk)` (filtered by ships watching the latest desk version). every time this scry is performed, `:vita` logs the size of the set with a timestamp. `:vita` keeps one copy of the latest full set of downloaders, and a cumulative set of all unique downloaders.

when users unsync from your local desk, `latest.downloads` wont go down until your next `|commit` to the desk.
`cumulative.downloads` only goes up.
Expand Down Expand Up @@ -113,13 +113,24 @@ the vita frontend displays the data collected by `:vita` plus some forms for app

## install from source

1. create a blank `%vita` desk.
2. copy in basic app dependencies.
1. ```bash
rm -rI vita-full/
find vita -type f | while read f; do { d=$(dirname "$f" | sed "s/^vita/vita-full/"); mkdir -p "$d"; ln -sr -t "$d" "$f"; }; done
git clone -b 411k --depth 1 https://github.com/urbit/urbit.git urb
cp urb/pkg/arvo/lib/{agentio*,verb*,strand*} vita-full/lib/
cp urb/pkg/arvo/sur/{spider*,verb*} vita-full/sur/
git clone -b sl/server-schooner-z412k --depth 1 https://github.com/sidnym-ladrut/yard.git yar
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick note here: I need to follow up with @sigilante to get the 412k schooner fix into %yard proper and then this code can just pull from the master branch. Alternatively, I can just omit these more explicit install instructions.

cp yar/desk/lib/{dbug*,default-agent*,skeleton*,rudder*,server*,docket*,mip*} vita-full/lib/
cp yar/desk/mar/{bill*,docket*,hoon*,kelvin*,mime*,noun*,ship*,json*} vita-full/mar/
cp yar/desk/sur/docket* vita-full/sur/
git clone -b v1.25.0 --depth 1 https://github.com/tloncorp/landscape.git lan
cp lan/desk/sur/treaty* vita-full/sur/
```
2. `|new-desk %vita`
3. `|mount %vita`
4. cd `<this_repo>/vita`
5. `./install.sh -w <my_pier>/vita`
6. `|commit %vita`
7. `|install our %vita`
4. `rm -rf <my_pier>/vita/*; cp -rf <this-repo>/vita-full <my_pier>/vita`
5. `|commit %vita`
6. `|install our %vita`

## urbit.org grant

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
:: Tell app whether to share usage data with :vita
::
:: :myagent +mydesk!share-usage
:: :myagent +mydesk!toggle-vita
:: enables sharing
:: :myagent +mydesk!share-usage &
:: :myagent +mydesk!toggle-vita &
:: enables sharing
:: :myagent +mydesk!share-usage |
:: :myagent +mydesk!toggle-vita |
:: disables sharing
::
:- %say
Expand All @@ -13,4 +13,4 @@
:- %set-enabled
?^ arg
share.arg
&
&
15 changes: 11 additions & 4 deletions vita-client/lib/vita-client.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
:: from somewhere that indicates real user activity
::
:: on %log-activity, we check if we already poked :~parent/vita today.
:: if so, ignore. if not, poke :~parent/vita with
:: if so, ignore. if not, poke :~parent/vita with
::
:: on init, vita-client can be set to be enabled / disabled by default.
:: on init, vita-client is configured with its parent @p
Expand Down Expand Up @@ -102,10 +102,10 @@
`this(config cfg.pok)
%log-activity
?. enabled.config
:: %- (slog leaf+"{<dap.bowl>} vita-client: not sending activity, disabled." ~)
:: %- (slog leaf+"{<dap.bowl>} vita-client: not sending activity, disabled." ~)
`this
?. (gth now.bowl (add last ~h8)) ::TODO ~d1 constant?
%- (slog leaf+"{<dap.bowl>} vita-client: not sending activity. already sent." ~)
:: %- (slog leaf+"{<dap.bowl>} vita-client: not sending activity. already sent." ~)
`this
=. last now.bowl
:_ this
Expand All @@ -132,7 +132,14 @@
++ on-peek
|= =path
^- (unit (unit cage))
(on-peek:ag path)
?. ?=([@ %vita *] path)
(on-peek:ag path)
?+ path [~ ~]
[%u %vita ~] ``noun+!>(&)
[%x %vita %last ~] ``noun+!>(last)
[%x %vita %enabled ~] ``noun+!>(enabled.config)
[%x %vita %parent ~] ``noun+!>(vita-parent.config)
==
::
++ on-agent
|= [=wire =sign:agent:gall]
Expand Down
19 changes: 12 additions & 7 deletions vita/app/vita.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:: accept foreign pokes attesting to activity on a desk
:: count unique active users each day
:: export to csv
::
::
/- sur=vita, tt=treaty
/+ vita
/+ default-agent, verb, dbug, agentio
Expand Down Expand Up @@ -250,7 +250,7 @@
|= [time=@da =duct]
^- ?
?. ?=(^ duct)
%.n
%.n
?=([%gall %use %vita *] i.duct)
%+ turn timers
|= [time=@da =duct]
Expand Down Expand Up @@ -290,10 +290,15 @@
++ scry-clay-subs
|= [desk=@tas]
^- (set ship)
=; s=(set ship)
%- (slog leaf+"vita: our {<desk>} has {<(lent ~(tap in s))>} subs" ~)
s
.^((set ship) %cs /[(scot %p our.bowl)]/[desk]/[(scot %da now.bowl)]/subs)
=- ((slog leaf+"vita: our {<desk>} has {<(lent ~(tap in -))>} subs" ~) -)
=+ [our=(scot %p our.bowl) now=(scot %da now.bowl)]
%- sy
%- turn :_ head
%+ skim ~(tap in .^((set [@p rave:clay]) %cx /[our]//[now]/cult/[desk]))
|= [@p rav=rave:clay]
?& ?=([%sing %w [%ud @] ~] rav)
.=(+>->.rav +(ud:.^(cass:clay %cw /[our]/[desk]/[now])))
==
::
++ scry-treaty-alliance
.^(update:alliance:tt %gx /[(scot %p our.bowl)]/treaty/[(scot %da now.bowl)]/alliance/noun)
Expand Down Expand Up @@ -400,4 +405,4 @@
new-met
new
==
--
--