Skip to content

Commit

Permalink
add stubs for UploaderState
Browse files Browse the repository at this point in the history
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
  • Loading branch information
wantguns committed Nov 26, 2022
1 parent 1c7638b commit 5b53312
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env.SharedLibrary('cereal_shared', cereal_objects)

# Build messaging

services_h = env.Command(['services.h'], ['services.py'], 'python3 ' + cereal_dir.path + '/services.py > $TARGET')
services_h = env.Command(['services.h'], ['services.py', 'resources/services.yaml'], 'python3 ' + cereal_dir.path + '/services.py > $TARGET')

messaging_objects = env.SharedObject([
'messaging/messaging.cc',
Expand Down
13 changes: 13 additions & 0 deletions log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,18 @@ struct LiveParametersData {
roll @14 :Float32;
}

struct UploaderState {
immediateQueueSize @0 :UInt32;
immediateQueueCount @1 :UInt32;
rawQueueSize @2 :UInt32;
rawQueueCount @3 :UInt32;

# stats for last successfully uploaded file
lastTime @4 :Float32; # s
lastSpeed @5 :Float32; # MB/s
lastFilename @6 :Text;
}

struct Event {
logMonoTime @33 :UInt64; # nanoseconds
valid @34 :Bool = true;
Expand Down Expand Up @@ -1079,5 +1091,6 @@ struct Event {
ubloxRaw @36 :Data;
liveTracks @37 :List(LiveTracks);
sentinel @38 :Sentinel;
uploaderState @39 :UploaderState;
}
}
2 changes: 2 additions & 0 deletions messaging/messaging.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once
#include <cstddef>
#include <ctime>
#include <map>
#include <string>
#include <vector>
#include <time.h>
#include <capnp/serialize.h>
#include "../gen/cpp/log.capnp.h"

Expand Down
6 changes: 6 additions & 0 deletions resources/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ services:
expectedFreq: 2
decimation: 1

uploaderState:
keepLast: true
log: true
expectedFreq: 2
decimation: 1

carEvents:
keepLast: true
log: true
Expand Down

0 comments on commit 5b53312

Please sign in to comment.