forked from Netflix/atlas
-
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.
eval: fix message drops for higher throughput (Netflix#1634)
Diagnostic messages and events were using the ds logger that has a separate queue. This made them prone to getting dropped if the throughput was high. Refactor to pass these messages over the same path as the data points.
- Loading branch information
1 parent
0ac5550
commit 2fb4f04
Showing
14 changed files
with
477 additions
and
69 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
atlas-eval/src/main/scala/com/netflix/atlas/eval/model/DatapointsTuple.scala
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 @@ | ||
/* | ||
* Copyright 2014-2024 Netflix, Inc. | ||
* | ||
* 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.netflix.atlas.eval.model | ||
|
||
import com.netflix.atlas.eval.stream.Evaluator | ||
|
||
/** | ||
* Pairs set of data points with other arbitrary messages to pass through to the | ||
* consumer. | ||
*/ | ||
case class DatapointsTuple( | ||
data: List[AggrDatapoint], | ||
messages: List[Evaluator.MessageEnvelope] = Nil | ||
) { | ||
|
||
def step: Long = { | ||
if (data.nonEmpty) data.head.step else 0L | ||
} | ||
|
||
def groupByStep: List[DatapointsTuple] = { | ||
val dps = data.groupBy(_.step).map(t => DatapointsTuple(t._2)).toList | ||
if (messages.nonEmpty) | ||
DatapointsTuple(Nil, messages) :: dps | ||
else | ||
dps | ||
} | ||
} |
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
40 changes: 40 additions & 0 deletions
40
atlas-eval/src/main/scala/com/netflix/atlas/eval/model/TimeGroupsTuple.scala
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 @@ | ||
/* | ||
* Copyright 2014-2024 Netflix, Inc. | ||
* | ||
* 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.netflix.atlas.eval.model | ||
|
||
import com.netflix.atlas.eval.stream.Evaluator | ||
|
||
/** | ||
* Pairs set of time groups with other arbitrary messages to pass through to the | ||
* consumer. | ||
*/ | ||
case class TimeGroupsTuple( | ||
groups: List[TimeGroup], | ||
messages: List[Evaluator.MessageEnvelope] = Nil | ||
) { | ||
|
||
def step: Long = { | ||
if (groups.nonEmpty) groups.head.step else 0L | ||
} | ||
|
||
def groupByStep: List[TimeGroupsTuple] = { | ||
val gps = groups.groupBy(_.step).map(t => TimeGroupsTuple(t._2)).toList | ||
if (messages.nonEmpty) | ||
TimeGroupsTuple(Nil, messages) :: gps | ||
else | ||
gps | ||
} | ||
} |
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
Oops, something went wrong.