-
Notifications
You must be signed in to change notification settings - Fork 129
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
Dart updates for ingest speed, correct time zone, tlmgrapher crash #779
Conversation
…dd status, and more
|
Codecov Report
@@ Coverage Diff @@
## master #779 +/- ##
==========================================
- Coverage 85.65% 85.34% -0.31%
==========================================
Files 159 160 +1
Lines 15041 15215 +174
==========================================
+ Hits 12884 12986 +102
- Misses 2157 2229 +72
Continue to review full report at Codecov.
|
@@ -6,6 +6,7 @@ DECLARE_TARGET INST | |||
DECLARE_TARGET INST INST2 | |||
DECLARE_TARGET EXAMPLE | |||
DECLARE_TARGET TEMPLATED | |||
DECLARE_TARGET DART |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically makes DART a part of the Demo now. Don't we need to modify the Gemfile to make sure we're including all the DART dependencies. I think you have it commented out right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a DART target, but it doesn't bring in all the gem requirements. I'll add DONT_CONNECT to the interface so that it doesn't add noise if DART is not running or used.
@@ -0,0 +1,2 @@ | |||
COMMAND DART CLEARERRORS BIG_ENDIAN "Clears error counters and messages" | |||
APPEND_ID_PARAMETER PACKETID 8 INT 1 1 1 "Packet Id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PACKET_ID
@@ -0,0 +1,40 @@ | |||
TELEMETRY DART STATUS BIG_ENDIAN "DART Status" | |||
APPEND_ID_ITEM PACKETID 8 INT 1 "Packet Id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PACKET_ID
demo/config/targets/DART/target.txt
Outdated
@@ -0,0 +1,7 @@ | |||
# Ignored Parameters | |||
# IGNORE_PARAMETER parameter_name | |||
IGNORE_PARAMETER PACKETID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PACKET_ID
demo/config/targets/DART/target.txt
Outdated
|
||
# Ignored Items | ||
# IGNORE_ITEM item_name | ||
IGNORE_ITEM PACKETID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PACKET_ID
@@ -146,8 +165,22 @@ def import(filename, force) | |||
meta_id = ple.id | |||
end | |||
end | |||
|
|||
if ple_data_count >= 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever optimization
@ple_data << "('#{entry_time}','#{entry_time}',#{target_id},#{packet_id},'#{packet.received_time.dup.utc.to_s(:db)}',#{@packet_log_id},#{@file_size},#{@meta_id},#{@is_tlm},true)" | ||
else | ||
@ple_data << ",('#{entry_time}','#{entry_time}',#{target_id},#{packet_id},'#{packet.received_time.dup.utc.to_s(:db)}',#{@packet_log_id},#{@file_size},#{@meta_id},#{@is_tlm},true)" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
super() | ||
@first = true | ||
@status_packet = System.telemetry.packet('DART', 'STATUS').clone | ||
@status_packet.write('PACKETID', 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PACKET_ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you also just do a restore_defaults here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only commands have defaults
@first = true | ||
@status_packet = System.telemetry.packet('DART', 'STATUS').clone | ||
@status_packet.write('PACKETID', 1) | ||
@clear_errors_command = System.commands.packet('DART', 'CLEARERRORS') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice this before but I'd prefer CLEAR_ERRORS here with an underscore.
canceled = false | ||
unless @first | ||
if @query_time | ||
sleep_time = 20.0 - (Time.now - @query_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the 20 should be a config parameter to the interface. Someone is going to want to speed up or slow this down. Perhaps you make a minimum limit on it. Not sure how long it takes but you're doing a bunch of DB stuff. Maybe 5s minimum?
Comments incorporated along with some other changes. ready for final review. |
start_time = first_packet.received_time | ||
end_time = last_packet.received_time | ||
rescue | ||
if size == 128 or size == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this magic number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the size of the normal COSMOS file header. I just checked in a change to remove the magic...
ensure | ||
reader.close | ||
end | ||
num_deleted = PacketLogEntry.where("time >= ? and time <= ? and packet_log_id = ?", start_time - 1.minute, end_time + 1.minute, packet_log.id).delete_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's with the +- 1 minute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just provides some tolerance incase the timestamps in the log were a little out of order. The packet_log_id constraint makes sure nothing extra is deleted.
and more
Still needs:
DART size optimization. DART grows way faster than the raw data right now. Need to eliminate some indexes and fields if possible.
New dart util needs to complete capability to remove files of data. To do this efficiently may need to add a packet_log_id to decom/reduced tables.
Investigate if string limit of 191 is wasting space
Decom needs to be faster. I increased the default num workers to 2, but it needs to run faster in general.