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

Add support for tracking Hadoop and GCS API level metrics at a thread… #1299

Open
wants to merge 2 commits into
base: branch-3.0.x
Choose a base branch
from

Conversation

arunkumarchacko
Copy link
Contributor

… level

GCS APIs which are called from a thread different the thre which called the Hadoop API is not captured. This will be fixed in a later change

… level

GCS APIs which are called from a thread different the thre which called the Hadoop API is not captured. This will be fixed in a later change
@arunkumarchacko
Copy link
Contributor Author

/gcbrun

import org.apache.hadoop.fs.StorageStatistics;

class GhfsThreadLocalStatistics extends StorageStatistics {
static final String NAME = "GhfsThreadLocalStatistics";
Copy link
Member

Choose a reason for hiding this comment

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

getClass().getName()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are string with special meaning. The consumer framework (eg. spark) will use this name to get the statistics.

}
}

void increment(GoogleCloudStorageStatistics op, long count) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: switch case?

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 in double minds since we are not handling all the enum cases. Will change if we add values.


class GhfsThreadLocalStatistics extends StorageStatistics {
static final String NAME = "GhfsThreadLocalStatistics";
static final String HADOOP_API_COUNT = "hadoopApiCount";
Copy link
Member

Choose a reason for hiding this comment

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

Enum would be better to represent this I think.

So ThreadLocalValue and corresponding strings stay together and not set different one by mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. The consumer framework is not aware of the enums and will have to use string to adhere to the interface.


void increment(GhfsStatistic statistic, long count) {
if (statistic == GCS_CONNECTOR_TIME) {
this.hadoopApiTime.increment(count);
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I am not able to understand this, why are we incrementing hadoopApiTime for GCS_CONNECTOR_TIME?

Also, the below metric (2 lines below) is Count while here it is Time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GCS connector implements Hadoop FS APIs. So we are measuring the wall clock time taken by GcsConnectorHadoopAPIs.

Another way to look at this is: From the caller perspective this the "hadoopAPITime" and from the connector perspective it is the GCSConnectorTime. Also, from the caller perspective they need the metric to be generic since the connector could be for a different scheme.

@arunkumarchacko
Copy link
Contributor Author

/gcbrun

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