Skip to content

Commit

Permalink
Add new shift metrics and update meta stats
Browse files Browse the repository at this point in the history
  • Loading branch information
adeveloper-wq committed Dec 1, 2023
1 parent 838627f commit e05ec35
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
7 changes: 4 additions & 3 deletions studies/db/go_rewrite/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"studies/things"
"studies/runner"
)

func main() {
Expand All @@ -11,9 +11,10 @@ func main() {
// Wait forever.
// select {}

tp := things.NewThingsProvider(false)
/* tp := things.NewThingsProvider(false)
tp.FilterOnlyPrimarySignalSecondarySignalAndCycleSecondDatastreams()
tldThings := tp.Things
println("Processing", len(tldThings), "things")
println("Processing", len(tldThings), "things") */

runner.Run()
}
1 change: 1 addition & 0 deletions studies/db/go_rewrite/meta_stats.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cs_observation_count_total": 961136904,
"intersections_with_observations": 731,
"ps_observation_count_total": 1171647438,
"things_with_observations": 18104
}
Binary file added studies/db/go_rewrite/processed_things_6.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions studies/db/go_rewrite/runner/runner_complete_cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ func RunCompleteCell(tldThings []things.TLDThing, suffixName string) map[string]
processedThings[name].Metrics[dayIdx] = thing.Metrics[dayIdx]
processedThings[name].MetricsSP[dayIdx] = thing.MetricsSP[dayIdx]
processedThings[name].MedianShifts[dayIdx] = thing.MedianShifts[dayIdx]
processedThings[name].ShiftsSum[dayIdx] = thing.ShiftsSum[dayIdx]
processedThings[name].MedianShiftsMedianDeviation[dayIdx] = thing.MedianShiftsMedianDeviation[dayIdx]
processedThings[name].MetricsRelativeGreenDistance[dayIdx] = thing.MetricsRelativeGreenDistance[dayIdx]
processedThings[name].MedianGreenLengths[dayIdx] = thing.MedianGreenLengths[dayIdx]
processedThings[name].Results[dayIdx] = thing.Results[dayIdx]
Expand Down
12 changes: 4 additions & 8 deletions studies/db/go_rewrite/runner/runner_meta_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,10 @@ func RunMeta() {
thingsWithObservationsTotal = append(thingsWithObservationsTotal, thingsWithObservations...)

for _, thing := range thingsWithObservations {
intersection_name := strings.Replace(thing, "_primary", "", 1)
intersection_name = strings.Replace(intersection_name, "_secondary", "", 1)
intersection_name = strings.Split(intersection_name, "_")[0]
intersection_name := strings.Split(thing, "_")[0]

if !stringInSlice(intersectionsWithObservationsTotal, intersection_name) {
intersectionsWithObservationsTotal = append(intersectionsWithObservationsTotal, thing)
intersectionsWithObservationsTotal = append(intersectionsWithObservationsTotal, intersection_name)
}
}

Expand All @@ -205,12 +203,10 @@ func RunMeta() {
}

for _, thing := range thingsWithObservations {
intersection_name := strings.Replace(thing, "_primary", "", 1)
intersection_name = strings.Replace(intersection_name, "_secondary", "", 1)
intersection_name = strings.Split(intersection_name, "_")[0]
intersection_name := strings.Split(thing, "_")[0]

if !stringInSlice(intersectionsWithObservationsTotal, intersection_name) {
intersectionsWithObservationsTotal = append(intersectionsWithObservationsTotal, thing)
intersectionsWithObservationsTotal = append(intersectionsWithObservationsTotal, intersection_name)
}
}

Expand Down

0 comments on commit e05ec35

Please sign in to comment.