Skip to content

Creating dev branch to base calc channels, rules, runs, and channels off #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ian-sift
Copy link
Contributor

@ian-sift ian-sift commented Jul 8, 2025

Data:

Getting data for multiple channels:
0: voltage: 100 points. Avg: 5.99
1: mainmotor.velocity: 29 points. Avg: 5.586206896551724
Start time: 2025-07-02 21:17:28.878926+00:00, End time: 2025-07-02 21:18:24.878785+00:00
2: gpio.12v: 89 points. Avg: 1.0
3: gpio.charge: 178 points. Avg: 0.8932584269662921
4: gpio.heater: 267 points. Avg: 0.6666666666666666
5: gpio.led: 356 points. Avg: 1.3089887640449438

=== Testing cache with varying time ranges ===

Test 1: Exact same time range no run_id (should hit cache)

Test 2: Subset of time range (should hit cache if overlapping)

Test 3: Extended time range earlier (should hit cache for overlapping portion)

Test 4: Different time encompassed range (should hit cache)

Test 5: No time range specified (should miss cache)
0: gpio.12v: 100 points. Avg: 1.0
1: gpio.charge: 100 points. Avg: 0.88
2: gpio.heater: 100 points. Avg: 0.19
3: gpio.led: 100 points. Avg: 3.07
4: voltage: 100 points. Avg: 5.02
5: mainmotor.velocity: 100 points. Avg: 5.24

Test 6: No time range specified again (should hit cache)
0: gpio.12v: 189 points. Avg: 1.0
1: gpio.charge: 189 points. Avg: 0.8359788359788359
2: gpio.heater: 189 points. Avg: 0.20105820105820105
3: gpio.led: 189 points. Avg: 3.1481481481481484
4: voltage: 200 points. Avg: 5.505
5: mainmotor.velocity: 129 points. Avg: 5.317829457364341

=== Cache Performance Summary ===
Original call: 0.3581 seconds
Exact time range no run_id: 0.0039 seconds (92.2x faster)
Subset time range: 0.0033 seconds (107.2x faster)
Extended time range earlier: 0.0892 seconds (4.0x faster)
Different time range: 0.0049 seconds (73.5x faster)
No time range: 0.8140 seconds (2.3x slower)
No time range repeat: 0.0023 seconds (360.6x faster) 

Ingestion https://app.development.siftstack.com/share/6E47Xye
Currently a little slow and not setup for bitfields or enums yet
Ingestion time: 0:01:07.627055 seconds
Ingested 2550 datapoints
Ingestion rate: 37.71 datapoints/second

@ian-sift ian-sift force-pushed the experimental/new-client-root branch 2 times, most recently from 38b2c3d to c160155 Compare July 17, 2025 01:55
@ian-sift ian-sift force-pushed the experimental/new-client-root branch from c160155 to 9e43905 Compare July 18, 2025 01:21
channel_values=rust_channel_values,
end_stream_on_validation_error=False,
organization_id=organization_id
or "", # This will be filled in by the server # TODO: Confirm w/ Ailin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we should be able to leave this unspecified -- the org ID can be resolved via the API key on the backend.



# Enum for channel data types (mimics protobuf values, but as int for now)
class ChannelDataType(int, Enum):
Copy link
Collaborator

Choose a reason for hiding this comment

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

For your consideration, there is a bytes type available now that we might want to start looking at including in places like this.

"""
super().__init__(grpc_client=grpc_client)
# TODO: Better way?
# Rust GRPC client expects URI to have http(s):// prefix.
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consideration: maybe urllib.parse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants