Skip to content
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

Packml statistics #40

Conversation

joshuaplusone
Copy link
Contributor

@joshuaplusone joshuaplusone commented Aug 3, 2018

@shaun-edwards This sets up the data structure for collecting packml stats.

@shaun-edwards shaun-edwards changed the title Kinetic devel Packml statistics Aug 6, 2018
Copy link
Collaborator

@shaun-edwards shaun-edwards left a comment

Choose a reason for hiding this comment

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

@joshuaplusone, I need your help to understand some of the structure and design decisions. Based on my understanding of the current structure, I expected the stats to come mostly from the existing state machine data. A separate class was probably appropriate, but for the most part should have been "reporting" data from the state machine (there are some exceptions, but not as many as I see in the code).

Please add an issue for test code. I believe we should address this ASAP, as it will also require testing for #37.

float32 availability # executing vs faulted
float32 performance # target rate vs cycle count
float32 quality # success vs fail
float32 overall_equipment_effectiveness # perf / quality
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be availability * performance * quality if I remember correctly.

float32 performance
float32 quality
float32 overall_equipment_effectiveness
float32 availability # executing vs faulted
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comments aren't quite correct. The details of the calculations can be found here.


bool transRequest(packml_msgs::Transition::Request& req, packml_msgs::Transition::Response& res);

private:
void handleStateChanged(packml_sm::AbstractStateMachine& state_machine, const packml_sm::StateChangedEventArgs& args);
bool resetStats(packml_msgs::ResetStats::Request& req, packml_msgs::ResetStats::Response& response);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So originally, the stats were envisioned as a topic with a reset service (#1). I'm not so much worried about that, but IF we want it to be a service API, perhaps we should change service type. It's a bit confusing that getStats takes a ResetStats type.

@@ -49,6 +50,11 @@ install(DIRECTORY include/${PROJECT_NAME}/boost/
FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY include/${PROJECT_NAME}/ros/
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is something I haven't seen before. I believe this will cause differences between "source" builds where packml is included in the ROS workspace vs "non-source" builds were packml is installed. Since we don't do these types of "non-source" builds, then it's probably likely we haven't ran into this yet.

@@ -68,6 +68,8 @@ class AbstractStateMachine
double getAbortedTime();
double getAbortingTime();

virtual void resetStats() = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason that this can't be implemented at the abstract level (maybe it will be obvious below).

is_faulted_ = is_faulted;
}

void PackmlStatsProvider::setTargetRate(float target_rate)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are the units of target_rate...I don't believe you captured that in header either.

target_rate_ = target_rate;
}

double PackmlStatsProvider::totalDuration() const
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why isn't this available from the state machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add it to the state machine.

return 0.0f;
}

float PackmlStatsProvider::availabilty() const
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please verify availability, performance, and quality calcs. I think they are slightly wrong, based on the wiki link above. The obvious problem is that none of these should ever be greater than 1.0


void PackmlStatsProvider::start()
{
start_time_ = std::chrono::steady_clock::now();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this time need to be stored locally, or can it be extracted from the state machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not currently tracking it in the state machine, but I will

packml_msgs::Status status_msg_;
packml_sm::PackmlStatsProvider stats_provider_;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about the stats provider requires it to be a ROS specific implementation? Shouldn't it be generic enough to capture the stats at a generic level? Shouldn't the ROS implementation just perform the conversion to ROS messages/services?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing, there is nothing ROS specific in it, other than a helper file for ROS implementations.

@shaun-edwards
Copy link
Collaborator

@joshuaplusone, have you created issues for testing this functionality?

@joshuaplusone
Copy link
Contributor Author

created issue for covering statistic gathering with unit tests here #41

@shaun-edwards shaun-edwards merged commit 20bf8a2 into ros-industrial-consortium:kinetic-devel Sep 4, 2018
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