Skip to content

Add queued store and display active users #1045

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

Merged
merged 9 commits into from
Jan 18, 2024
Merged

Add queued store and display active users #1045

merged 9 commits into from
Jan 18, 2024

Conversation

jmthomas
Copy link
Member

No description provided.

@jmthomas jmthomas requested a review from ryanmelt January 12, 2024 18:11
Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (0f0e61d) 75.32% compared to head (4a23eee) 75.36%.

Files Patch % Lines
openc3/lib/openc3/utilities/store_queued.rb 89.09% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1045      +/-   ##
==========================================
+ Coverage   75.32%   75.36%   +0.03%     
==========================================
  Files         590      592       +2     
  Lines       43138    43197      +59     
  Branches      746      746              
==========================================
+ Hits        32493    32554      +61     
+ Misses      10566    10564       -2     
  Partials       79       79              
Flag Coverage Δ
python 83.62% <ø> (+0.06%) ⬆️
ruby-api 48.76% <100.00%> (+0.05%) ⬆️
ruby-backend 80.45% <89.09%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

module OpenC3
class StoreQueued
# How often in seconds the store is updated
UPDATE_INTERVAL = 2
Copy link
Member

Choose a reason for hiding this comment

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

why 2?

Copy link
Member

Choose a reason for hiding this comment

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

This needs to be an argument to the instance on first use (like System). I want to use this same class to implement #987

# Mutex used to ensure that only one instance is created
@@instance_mutex = Mutex.new

# Thread used to post metrics across all classes
Copy link
Member

Choose a reason for hiding this comment

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

metrics?

Copy link
Member Author

Choose a reason for hiding this comment

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

typo

end
end

def self.shutdown
Copy link
Member

Choose a reason for hiding this comment

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

who calls this?

Copy link
Member Author

Choose a reason for hiding this comment

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

no one ... it's left over from the metrics thread I borrowed

Copy link
Member

Choose a reason for hiding this comment

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

Should be added to at_exit when instance created

Copy link
Member

Choose a reason for hiding this comment

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

Should be instance method

@store_queue = Queue.new

at_exit() do
self.shutdown()
Copy link
Member

Choose a reason for hiding this comment

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

Make shutdown an instance method

@@instance_mutex = Mutex.new

# Thread used to call methods on the store
@@update_thread = nil
Copy link
Member

Choose a reason for hiding this comment

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

This should just be an instance variable

@@update_thread = nil

# Sleeper used to delay update thread
@@update_sleeper = nil
Copy link
Member

Choose a reason for hiding this comment

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

This should just be an instance variable

end
end

def self.shutdown
Copy link
Member

Choose a reason for hiding this comment

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

Should be instance method

@ryanmelt
Copy link
Member

Let me make some changes to this one before you merge it.

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@ryanmelt ryanmelt merged commit ebe2f07 into main Jan 18, 2024
@ryanmelt ryanmelt deleted the logged_in_users branch January 18, 2024 20:33
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