Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
e9ac8875
Commit
e9ac8875
authored
11 years ago
by
jerryshao
Browse files
Options
Downloads
Patches
Plain Diff
Remove twice add Source bug and code clean
parent
e080588f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/scala/spark/metrics/MetricsSystem.scala
+4
-6
4 additions, 6 deletions
core/src/main/scala/spark/metrics/MetricsSystem.scala
core/src/main/scala/spark/metrics/source/JvmSource.scala
+6
-6
6 additions, 6 deletions
core/src/main/scala/spark/metrics/source/JvmSource.scala
with
10 additions
and
12 deletions
core/src/main/scala/spark/metrics/MetricsSystem.scala
+
4
−
6
View file @
e9ac8875
package
spark.metrics
import
scala.collection.mutable
import
com.codahale.metrics.
{
JmxReporter
,
MetricSet
,
MetricRegistry
}
import
java.util.Properties
import
java.util.concurrent.TimeUnit
import
scala.collection.mutable
import
spark.Logging
import
spark.metrics.sink.
_
import
spark.metrics.source.
_
import
spark.metrics.sink.
Sink
import
spark.metrics.source.
Source
private
[
spark
]
class
MetricsSystem
private
(
val
instance
:
String
)
extends
Logging
{
initLogging
()
...
...
@@ -46,7 +46,6 @@ private[spark] class MetricsSystem private (val instance: String) extends Loggin
val
classPath
=
kv
.
_2
.
getProperty
(
"class"
)
try
{
val
source
=
Class
.
forName
(
classPath
).
newInstance
()
sources
+=
source
.
asInstanceOf
[
Source
]
registerSource
(
source
.
asInstanceOf
[
Source
])
}
catch
{
case
e
:
Exception
=>
logError
(
"source class "
+
classPath
+
" cannot be instantialized"
,
e
)
...
...
@@ -58,7 +57,6 @@ private[spark] class MetricsSystem private (val instance: String) extends Loggin
val
instConfig
=
metricsConfig
.
getInstance
(
instance
)
val
sinkConfigs
=
MetricsConfig
.
subProperties
(
instConfig
,
MetricsSystem
.
SINK_REGEX
)
// Register other sinks according to conf
sinkConfigs
.
foreach
{
kv
=>
val
classPath
=
if
(
MetricsSystem
.
DEFAULT_SINKS
.
contains
(
kv
.
_1
))
{
MetricsSystem
.
DEFAULT_SINKS
(
kv
.
_1
)
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/metrics/source/JvmSource.scala
+
6
−
6
View file @
e9ac8875
package
spark.metrics.source
import
java.util.
{
Map
,
HashMap
=>
JHashMap
}
import
com.codahale.metrics.MetricRegistry
import
com.codahale.metrics.jvm.
{
GarbageCollectorMetricSet
,
MemoryUsageGaugeSet
}
import
java.util.
{
Map
,
HashMap
=>
JHashMap
}
class
JvmSource
extends
Source
{
val
sourceName
=
"jvm"
val
metricRegistry
=
new
MetricRegistry
()
val
gcMetricSet
=
new
GarbageCollectorMetricSet
val
memGaugeSet
=
new
MemoryUsageGaugeSet
val
gcMetricSet
=
new
GarbageCollectorMetricSet
val
memGaugeSet
=
new
MemoryUsageGaugeSet
metricRegistry
.
registerAll
(
gcMetricSet
)
metricRegistry
.
registerAll
(
memGaugeSet
)
metricRegistry
.
registerAll
(
gcMetricSet
)
metricRegistry
.
registerAll
(
memGaugeSet
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment