Skip to content

Commit

Permalink
ciao-launcher: Send stats every 6 seconds
Browse files Browse the repository at this point in the history
Previously stats were sent every 30 seconds by launcher.  This commit
changes the period to 6 seconds.  Instance resources are still computed
every 30 seconds and so will only update every 30 seconds in the UI.
Instance state, however, should now get updated every 6 seconds.

Fixes ciao-project#282

Signed-off-by: Mark Ryan <[email protected]>
  • Loading branch information
Mark Ryan committed Jul 12, 2016
1 parent b423f16 commit 4838236
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ciao-launcher/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ DONE:
case <-id.statsTimer:
d, m, c := id.vm.stats()
id.ovsCh <- &ovsStatsUpdateCmd{id.instance, m, d, c}
id.statsTimer = time.After(time.Second * statsPeriod)
id.statsTimer = time.After(time.Second * resourcePeriod)
case cmd := <-id.cmdCh:
if !id.instanceCommand(cmd) {
break DONE
Expand All @@ -296,7 +296,7 @@ DONE:
id.ovsCh <- &ovsStateChange{id.instance, ovsRunning}
d, m, c := id.vm.stats()
id.ovsCh <- &ovsStatsUpdateCmd{id.instance, m, d, c}
id.statsTimer = time.After(time.Second * statsPeriod)
id.statsTimer = time.After(time.Second * resourcePeriod)
}
}

Expand Down
13 changes: 7 additions & 6 deletions ciao-launcher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ func init() {
}

const (
lockDir = "/tmp/lock/ciao"
instancesDir = "/var/lib/ciao/instances"
logDir = "/var/lib/ciao/logs/launcher"
instanceState = "state"
lockFile = "client-agent.lock"
statsPeriod = 30
lockDir = "/tmp/lock/ciao"
instancesDir = "/var/lib/ciao/instances"
logDir = "/var/lib/ciao/logs/launcher"
instanceState = "state"
lockFile = "client-agent.lock"
statsPeriod = 6
resourcePeriod = 30
)

type cmdWrapper struct {
Expand Down

0 comments on commit 4838236

Please sign in to comment.