-
Notifications
You must be signed in to change notification settings - Fork 807
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sql): log the size of executions when they complete (#4660)
to make changes in size over time more observable. This makes it easier to see the impact of features like the artifact store. Not setting the size in RedisExecutionRepository because the extra objectMapper.writeValueAsString is potentially expensive and I'm not sure how many folks are using redis for this. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
38b447f
commit fff90a4
Showing
9 changed files
with
239 additions
and
1 deletion.
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
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
77 changes: 77 additions & 0 deletions
77
...re/src/test/java/com/netflix/spinnaker/orca/pipeline/model/PipelineExecutionImplTest.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,77 @@ | ||
/* | ||
* Copyright 2024 Salesforce, 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.spinnaker.orca.pipeline.model; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionType; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class PipelineExecutionImplTest { | ||
|
||
private PipelineExecutionImpl pipelineExecution; | ||
|
||
private StageExecutionImpl stageExecution; | ||
|
||
@BeforeEach | ||
void setup() { | ||
pipelineExecution = new PipelineExecutionImpl(ExecutionType.PIPELINE, "test-application"); | ||
stageExecution = new StageExecutionImpl(); | ||
stageExecution.setExecution(pipelineExecution); | ||
pipelineExecution.getStages().add(stageExecution); | ||
} | ||
|
||
@Test | ||
void getTotalSizeMissingPipelineSize() { | ||
// given | ||
assertThat(pipelineExecution.getSize()).isEmpty(); | ||
|
||
// then | ||
assertThat(pipelineExecution.getTotalSize()).isEmpty(); | ||
} | ||
|
||
@Test | ||
void getTotalSizeMissingStageSize() { | ||
// given | ||
long pipelineSize = 14; // arbitrary | ||
|
||
pipelineExecution.setSize(pipelineSize); | ||
assertThat(pipelineExecution.getSize()).isPresent(); | ||
|
||
assertThat(stageExecution.getSize()).isEmpty(); | ||
|
||
// then | ||
assertThat(pipelineExecution.getTotalSize()).isEmpty(); | ||
} | ||
|
||
@Test | ||
void getTotalSizeCompleteInfo() { | ||
// given | ||
long pipelineSize = 5; // arbitrary | ||
long stageSize = 7; // arbitrary | ||
|
||
pipelineExecution.setSize(pipelineSize); | ||
assertThat(pipelineExecution.getSize()).isPresent(); | ||
|
||
stageExecution.setSize(stageSize); | ||
assertThat(stageExecution.getSize()).isPresent(); | ||
|
||
// then | ||
assertThat(pipelineExecution.getTotalSize().get()).isEqualTo(pipelineSize + stageSize); | ||
} | ||
} |
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