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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7784446
Dart updates for ingest speed, correct time zone, tlmgrapher crash, a…
ryanmelt 609d6af
Merge branch 'master' into dart_updates
ryanmelt 7571c3d
fix bugs. incorporate jasons comments. Make specs pass
ryanmelt ba43cb8
remove magic number
ryanmelt File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
# encoding: ascii-8bit | ||
require 'cosmos' | ||
require 'cosmos/dart/processes/dart_util' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
COMMAND DART CLEAR_ERRORS BIG_ENDIAN "Clears error counters and messages" | ||
APPEND_ID_PARAMETER PACKET_ID 8 INT 1 1 1 "Packet Id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
TELEMETRY DART STATUS BIG_ENDIAN "DART Status" | ||
APPEND_ID_ITEM PACKET_ID 8 INT 1 "Packet Id" | ||
APPEND_ITEM LAST_PLE_ID 64 INT "Database ID of the most recent PacketLogEntry created" | ||
APPEND_ITEM PLE_STATE_NEED_DECOM 64 INT "Number of PacketLogEntries ready for decom" | ||
APPEND_ITEM PLE_STATE_ERROR 64 INT "Number of PacketLogEntries with errors" | ||
APPEND_ITEM DECOM_COUNT 64 INT "Count of packets decommutated" | ||
APPEND_ITEM DECOM_ERROR_COUNT 64 INT "Count of decommutation errors" | ||
APPEND_ITEM DECOM_MESSAGE 2048 STRING "Most recent decommutation message" | ||
APPEND_ITEM REDUCTION_COUNT 64 INT "Count of packet reduced since DART started" | ||
APPEND_ITEM REDUCTION_ERROR_COUNT 64 INT "Count of reduction errors" | ||
APPEND_ITEM REDUCTION_MESSAGE 2048 STRING "Most recent reduction message" | ||
APPEND_ITEM DART_DATA_BYTES 64 INT "Size of the DART Data folder in bytes" | ||
POLY_READ_CONVERSION 0 0.0000000009313225746154785 | ||
UNITS GB GB | ||
FORMAT_STRING "%0.2f" | ||
APPEND_ITEM DART_LOGS_BYTES 64 INT "Size of the DART Logs folder in bytes" | ||
POLY_READ_CONVERSION 0 0.0000000009313225746154785 | ||
UNITS GB GB | ||
FORMAT_STRING "%0.2f" | ||
APPEND_ITEM DART_DATABASE_BYTES 64 INT "Size of the DART Postgres database in bytes" | ||
POLY_READ_CONVERSION 0 0.0000000009313225746154785 | ||
UNITS GB GB | ||
FORMAT_STRING "%0.2f" | ||
APPEND_ITEM DART_STATUS_SECONDS 64 FLOAT "Seconds to complete status queries" | ||
APPEND_ITEM PLE_FIRST_TIME_S 64 INT "Time of the first PacketLogEntry in the database seconds" | ||
APPEND_ITEM PLE_FIRST_TIME_US 64 INT "Time of the first PacketLogEntry in the database microseconds" | ||
APPEND_ITEM PLE_LAST_TIME_S 64 INT "Time of the last PacketLogEntry in the database seconds" | ||
APPEND_ITEM PLE_LAST_TIME_US 64 INT "Time of the last PacketLogEntry in the database microseconds" | ||
APPEND_ITEM DECOM_MESSAGE_TIME_S 64 INT "Time of decommutation message seconds" | ||
APPEND_ITEM DECOM_MESSAGE_TIME_US 64 INT "Time of decommutation message microseconds" | ||
APPEND_ITEM REDUCTION_MESSAGE_TIME_S 64 INT "Time of reduction message seconds" | ||
APPEND_ITEM REDUCTION_MESSAGE_TIME_US 64 INT "Time of reduction message microseconds" | ||
ITEM PLE_FIRST_TIME 0 0 DERIVED "Time of the first PacketLogEntry in the database" | ||
READ_CONVERSION unix_time_formatted_conversion.rb PLE_FIRST_TIME_S PLE_FIRST_TIME_US | ||
ITEM PLE_LAST_TIME 0 0 DERIVED "Time of the last PacketLogEntry in the database" | ||
READ_CONVERSION unix_time_formatted_conversion.rb PLE_LAST_TIME_S PLE_LAST_TIME_US | ||
ITEM DECOM_MESSAGE_TIME 0 0 DERIVED "Time of decommutation message" | ||
READ_CONVERSION unix_time_formatted_conversion.rb DECOM_MESSAGE_TIME_S DECOM_MESSAGE_TIME_US | ||
ITEM REDUCTION_MESSAGE_TIME 0 0 DERIVED "Time of reduction message" | ||
READ_CONVERSION unix_time_formatted_conversion.rb REDUCTION_MESSAGE_TIME_S REDUCTION_MESSAGE_TIME_US |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This is a segment of the main cmd_tlm_server.txt that will be used with | ||
# AUTO_INTERFACE_TARGETS or INTERFACE_TARGET | ||
|
||
INTERFACE DART_INT dart_status_interface.rb | ||
TARGET DART | ||
DONT_CONNECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
SCREEN AUTO AUTO 1.0 FIXED | ||
|
||
VERTICAL | ||
|
||
TITLE "DART Status" | ||
|
||
HORIZONTAL | ||
VERTICALBOX | ||
SECTIONHEADER "Ingest Status" | ||
|
||
LABELVALUE DART STATUS LAST_PLE_ID | ||
LABELVALUE DART STATUS PLE_STATE_ERROR | ||
LABELVALUE DART STATUS PLE_FIRST_TIME WITH_UNITS 22 | ||
LABELVALUE DART STATUS PLE_LAST_TIME WITH_UNITS 22 | ||
END | ||
|
||
VERTICALBOX | ||
SECTIONHEADER "Decom Status" | ||
|
||
LABELVALUE DART STATUS PLE_STATE_NEED_DECOM | ||
LABELVALUE DART STATUS DECOM_COUNT | ||
LABELVALUE DART STATUS DECOM_ERROR_COUNT | ||
LABELVALUE DART STATUS DECOM_MESSAGE_TIME WITH_UNITS 22 | ||
LABEL DECOM_MESSAGE: | ||
VALUE DART STATUS DECOM_MESSAGE CONVERTED 50 | ||
END | ||
END | ||
HORIZONTAL | ||
VERTICALBOX | ||
SECTIONHEADER "Reduction Status" | ||
|
||
LABELVALUE DART STATUS REDUCTION_COUNT | ||
LABELVALUE DART STATUS REDUCTION_ERROR_COUNT | ||
LABELVALUE DART STATUS REDUCTION_MESSAGE_TIME WITH_UNITS 22 | ||
LABEL REDUCTION_MESSAGE: | ||
VALUE DART STATUS REDUCTION_MESSAGE CONVERTED 50 | ||
END | ||
|
||
VERTICALBOX | ||
SECTIONHEADER "Dart Database Status" | ||
|
||
LABELVALUE DART STATUS DART_DATA_BYTES | ||
LABELVALUE DART STATUS DART_LOGS_BYTES | ||
LABELVALUE DART STATUS DART_DATABASE_BYTES | ||
LABELVALUE DART STATUS DART_STATUS_SECONDS | ||
END | ||
|
||
END | ||
|
||
VERTICALBOX | ||
LABELVALUE DART STATUS RECEIVED_TIMEFORMATTED WITH_UNITS 22 | ||
END | ||
END | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Ignored Parameters | ||
# IGNORE_PARAMETER parameter_name | ||
IGNORE_PARAMETER PACKET_ID | ||
|
||
# Ignored Items | ||
# IGNORE_ITEM item_name | ||
IGNORE_ITEM PACKET_ID |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Status < ApplicationRecord | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/cosmos/dart/db/migrate/20180423205644_create_statuses.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class CreateStatuses < ActiveRecord::Migration[5.1] | ||
def change | ||
create_table :statuses do |t| | ||
t.bigint :decom_count, :default => 0 | ||
t.bigint :decom_error_count, :default => 0 | ||
t.text :decom_message, :default => "" | ||
t.datetime :decom_message_time | ||
|
||
t.bigint :reduction_count, :default => 0 | ||
t.bigint :reduction_error_count, :default => 0 | ||
t.text :reduction_message, :default => "" | ||
t.datetime :reduction_message_time | ||
|
||
t.timestamps | ||
end | ||
status = Status.new | ||
time = Time.utc(1970, 1, 1) | ||
status.decom_message_time = time | ||
status.reduction_message_time = time | ||
status.save! | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
lib/cosmos/dart/db/migrate/20180425211340_add_decom_state_index.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddDecomStateIndex < ActiveRecord::Migration[5.1] | ||
def change | ||
add_index :packet_log_entries, [:decom_state] | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
lib/cosmos/dart/db/migrate/20180509204705_remove_indexes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class RemoveIndexes < ActiveRecord::Migration[5.1] | ||
|
||
def change | ||
remove_index :packet_log_entries, :is_tlm | ||
remove_index :packet_log_entries, :target_id | ||
remove_index :packet_log_entries, :meta_id | ||
remove_index :packet_log_entries, :ready | ||
remove_index :packet_log_entries, :packet_id | ||
remove_index :packet_log_entries, :packet_log_id | ||
|
||
ActiveRecord::Base.connection.tables.each do |table| | ||
# Since the decommutation tables are created dynamically we search | ||
# through all the tables looking for tables named something like | ||
# tXXX_YYY where XXX is the PacketConfig ID and YYY is the table index | ||
if table.to_s =~ /^t(\d+)_(\d+)$/ # ASCII art? No! Regex! | ||
packet_config_id = $1.to_i | ||
table_index = $2.to_i | ||
|
||
["", "_m", "_h", "_d"].each do |modifier| | ||
table_name = table + modifier | ||
remove_index table_name, :meta_id | ||
remove_index table_name, :reduced_id | ||
remove_index table_name, :reduced_state | ||
add_index table_name, :reduced_state, :where => "reduced_state < 2" | ||
end | ||
end | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
lib/cosmos/dart/db/migrate/20180510160002_remove_timestamps_from_ples.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class RemoveTimestampsFromPles < ActiveRecord::Migration[5.1] | ||
def change | ||
remove_column :packet_log_entries, :created_at | ||
remove_column :packet_log_entries, :updated_at | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
lib/cosmos/dart/db/migrate/20180511194944_add_packet_log_id_to_tables.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class AddPacketLogIdToTables < ActiveRecord::Migration[5.1] | ||
def change | ||
ActiveRecord::Base.connection.tables.each do |table| | ||
# Since the decommutation tables are created dynamically we search | ||
# through all the tables looking for tables named something like | ||
# tXXX_YYY where XXX is the PacketConfig ID and YYY is the table index | ||
if table.to_s =~ /^t(\d+)_(\d+)$/ # ASCII art? No! Regex! | ||
packet_config_id = $1.to_i | ||
table_index = $2.to_i | ||
|
||
["", "_m", "_h", "_d"].each do |modifier| | ||
table_name = table + modifier | ||
add_column table_name, :packet_log_id, :integer | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.