forked from linkedin/dr-elephant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request linkedin#109 from nntnag17/master
Aggregated Metrics Feature
- Loading branch information
Showing
68 changed files
with
3,341 additions
and
168 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright 2016 LinkedIn Corp. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
use this file except in compliance with the License. You may obtain a copy of | ||
the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
License for the specific language governing permissions and limitations under | ||
the License. | ||
--> | ||
|
||
<!-- Data aggregators configurations | ||
An Aggregator implements HadoopMetricsAggregator interface and help aggregate a certain application type data. | ||
Example: | ||
<aggregator> | ||
# Choose the application type that this aggregator is for | ||
<applicationtype>mapreduce</applicationtype> | ||
# Specify the implementation class | ||
<classname>com.linkedin.drelephant.mapreduce.MapReduceAggregator</classname> | ||
</aggregator> | ||
--> | ||
<aggregators> | ||
<aggregator> | ||
<applicationtype>mapreduce</applicationtype> | ||
<classname>com.linkedin.drelephant.mapreduce.MapReduceMetricsAggregator</classname> | ||
</aggregator> | ||
<aggregator> | ||
<applicationtype>spark</applicationtype> | ||
<classname>org.apache.spark.SparkMetricsAggregator</classname> | ||
</aggregator> | ||
</aggregators> |
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
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
76 changes: 76 additions & 0 deletions
76
app/com/linkedin/drelephant/analysis/HadoopAggregatedData.java
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,76 @@ | ||
/* | ||
* Copyright 2016 LinkedIn Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.linkedin.drelephant.analysis; | ||
|
||
/** | ||
* This class contains the aggregated data of a job | ||
*/ | ||
public class HadoopAggregatedData { | ||
|
||
private long resourceUsed = 0; | ||
private long resourceWasted = 0; | ||
private long totalDelay = 0; | ||
|
||
/** | ||
* Returns the resource usage of the job | ||
* @return The resource usage of the job | ||
*/ | ||
public long getResourceUsed() { | ||
return resourceUsed; | ||
} | ||
|
||
/** | ||
* Setter for the resource usage of the job | ||
* @param resourceUsed The resource usage of the job | ||
*/ | ||
public void setResourceUsed(long resourceUsed) { | ||
this.resourceUsed = resourceUsed; | ||
} | ||
|
||
/** | ||
* Returns the wasted resources of the job | ||
* @return The wasted resources of the job | ||
*/ | ||
public long getResourceWasted() { | ||
return resourceWasted; | ||
} | ||
|
||
/** | ||
* Setter for the wasted resources | ||
* @param resourceWasted The wasted resources of the job | ||
*/ | ||
public void setResourceWasted(long resourceWasted) { | ||
this.resourceWasted = resourceWasted; | ||
} | ||
|
||
/** | ||
* returns the total delay of the job | ||
* @return The total delay of the job | ||
*/ | ||
public long getTotalDelay() { | ||
return totalDelay; | ||
} | ||
|
||
/** | ||
* Setter for the total delay of the job | ||
* @param totalDelay The total delay of the job | ||
*/ | ||
public void setTotalDelay(long totalDelay) { | ||
this.totalDelay = totalDelay; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
app/com/linkedin/drelephant/analysis/HadoopMetricsAggregator.java
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 @@ | ||
/* | ||
* Copyright 2016 LinkedIn Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.linkedin.drelephant.analysis; | ||
|
||
public interface HadoopMetricsAggregator { | ||
public void aggregate(HadoopApplicationData data); | ||
public HadoopAggregatedData getResult(); | ||
} |
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,60 @@ | ||
/* | ||
* Copyright 2016 LinkedIn Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.linkedin.drelephant.analysis; | ||
|
||
public enum Metrics { | ||
|
||
// Currently supported metrics | ||
USED_RESOURCES("Used Resources", "resources", "The resources used by the job"), | ||
WASTED_RESOURCES("Wasted Resources", "resources", "The resources wasted by the job"), | ||
RUNTIME("Run Time", "time", "The run time of the job"), | ||
WAIT_TIME("Wait Time", "time", "The wait time of the job"); | ||
|
||
private String text; | ||
private String type; | ||
private String description; | ||
|
||
Metrics(String text, String type, String description) { | ||
this.text = text; | ||
this.type = type; | ||
this.description = description; | ||
} | ||
|
||
/** | ||
* Returns the value of the text for the metrics | ||
* @return The text value | ||
*/ | ||
public String getText() { | ||
return text; | ||
} | ||
|
||
/** | ||
* Returns the type of the metrics. It can be one of resources or time | ||
* @return The type of the metrics. | ||
*/ | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* Returns the description of the metrics | ||
* @return The description of the metrics | ||
*/ | ||
public String getDescription() { | ||
return description; | ||
} | ||
} |
Oops, something went wrong.