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

master <-- JCSP-515: fixing jpt for equifax run #69

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cohort-secrets/example.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# copy this as `a.properties` and `b.properties` and update the values
# copy this as `a.properties` and `ms.properties` and update the values
jira.uri=http://127.0.0.1:8080/
user.name=admin
user.password=admin
Expand Down
1 change: 1 addition & 0 deletions custom-vu/src/main/kotlin/jces1209/vu/JiraDcScenario.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class JiraDcScenario : Scenario {
columnsEditor = DcColumnsEditor(jira.driver),
topBar = DcTopBar(jira.driver),
sideBar = DcSideBar(jira)

)
}
}
4 changes: 2 additions & 2 deletions custom-vu/src/main/kotlin/jces1209/vu/MeasureType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class MeasureType {
val BROWSE_PROJECT_ISSUES = ActionType("Browse project issues") { Unit }

@JvmField
var OPEN_MEDIA_VIEWER = ActionType("Quick search top bar") { Unit }
var OPEN_GLOBAL_SEARCH = ActionType("Global Issue Navigator") { Unit }

@JvmField
var OPEN_GLOBAL_SEARCH = ActionType("Quick search top bar") { Unit }
var OPEN_MEDIA_VIEWER = ActionType("Quick search top bar") { Unit }

@JvmField
var VIEW_DASHBOARDS = ActionType("View Dasboards List") { Unit }
Expand Down
49 changes: 25 additions & 24 deletions custom-vu/src/main/kotlin/jces1209/vu/ScenarioSimilarities.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class ScenarioSimilarities(
meter = meter,
issueKeyMemory = issueKeyMemory,
random = seededRandom,
editProbability = 0.00f, // 0.10f if we can mutate data
commentProbability = 0.00f, // 0.04f if we can mutate data
linkIssueProbability = 0.00f, // 0.10f if we can mutate data
attachScreenShotProbability = 0.05f,
changeAssigneeProbability = 0.00f,
mentionUserProbability = 0.00f,
transitionProbability = 0.00f,
contextOperationProbability = 0.05f
editProbability = 0.0f, // 0.10f if we can mutate data
commentProbability = 0.0f, // 0.04f if we can mutate data
linkIssueProbability = 0.0f, // 0.10f if we can mutate data
attachScreenShotProbability = 0.0f,
changeAssigneeProbability = 0.0f,
mentionUserProbability = 0.0f,
transitionProbability = 0.0f,
contextOperationProbability = 0.0f
),
projectSummary = ProjectSummaryAction(
jira = jira,
Expand Down Expand Up @@ -113,11 +113,11 @@ class ScenarioSimilarities(
filters = filtersMemory,
jqlMemory = jqlMemory,
issueKeyMemory = issueKeyMemory,
searchFilterProbability = 0.50f,
searchJclProbability = 0.05f,
globalSearchProbability = 0.05f,
customizeColumnsProbability = 0.05f,
switchBetweenIssuesProbability = 0.05f
searchFilterProbability = 0.0f,
searchJclProbability = 0.0f,
globalSearchProbability = 0.9f,
customizeColumnsProbability = 0.0f,
switchBetweenIssuesProbability = 0.0f
),
workOnTransition = WorkOnTransition(
meter = meter,
Expand All @@ -141,21 +141,22 @@ class ScenarioSimilarities(
workOnSearch: Action,
workOnTopBar: Action,
workOnTransition: Action

): List<Action> {
val exploreData = listOf(browseProjects, browseFilters, browseBoards)
val spreadOut = mapOf(
createIssue to 0, // 5 if we can mutate data
workAnIssue to 55,
projectSummary to 5,
browseProjects to 5,
browseBoards to 5,
viewBoard to 30,
workOnDashboard to 5,
workOnSprint to 10,
browseProjectIssues to 5,
workOnSearch to 5,
workOnTopBar to 5,
workOnTransition to 5
workAnIssue to 10,//10
projectSummary to 0,
browseProjects to 0,
browseBoards to 20,//20
viewBoard to 20,//20
workOnDashboard to 20,//20
workOnSprint to 0,
browseProjectIssues to 0,
workOnSearch to 30,//30
workOnTopBar to 0,
workOnTransition to 0
)
.map { (action, proportion) -> Collections.nCopies(proportion, action) }
.flatten()
Expand Down
14 changes: 12 additions & 2 deletions custom-vu/src/main/kotlin/jces1209/vu/action/ViewBoard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ class ViewBoard(
key = VIEW_BOARD,
action = {
meter.measure(
key = ActionType("View Board ($boardType)") { Unit },
key = if (boardType == "Backlog") {
ActionType("View $boardType") { Unit }
} else {
ActionType("View $boardType Board ") { Unit }
},
action = {
board
.goToBoard()
Expand Down Expand Up @@ -89,7 +93,13 @@ class ViewBoard(
private fun previewIssue(boardType: String, board: BoardPage) {
jiraTips.closeTips()
meter.measure(MeasureType.ISSUE_PREVIEW_BOARD) {
meter.measure(ActionType("Preview issue ($boardType board)") { Unit }) {
var message: String
if (boardType == "Backlog") {
message = "Old issue view $boardType"
} else {
message = "Old issue view $boardType board"
}
meter.measure(ActionType(message) { Unit }) {
board.previewIssue()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class WorkOnDashboard(
) : Action {
private val logger: Logger = LogManager.getLogger(this::class.java)
override fun run() {
viewDashboards()
val dashboardName = createDashboard()
createGadget(dashboardPage, dashboardName)
// viewDashboards()
// val dashboardName = createDashboard()
openDashboard(dashboardPage)
// createGadget(dashboardPage, dashboardName)
}

private fun viewDashboards() {
Expand Down
2 changes: 0 additions & 2 deletions custom-vu/src/main/kotlin/jces1209/vu/action/WorkOnIssue.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import jces1209.vu.MeasureType.Companion.ISSUE_LINK_SEARCH_CHOOSE
import jces1209.vu.MeasureType.Companion.ISSUE_LINK_SUBMIT
import jces1209.vu.MeasureType.Companion.OPEN_MEDIA_VIEWER
import jces1209.vu.page.AbstractIssuePage
import jces1209.vu.page.AttachScreenShot
import org.apache.logging.log4j.LogManager
import org.apache.logging.log4j.Logger

Expand All @@ -37,7 +36,6 @@ class WorkOnIssue(
private val transitionProbability: Float
) : Action {
private val logger: Logger = LogManager.getLogger(this::class.java)

override fun run() {
val issueKey = issueKeyMemory.recall()
if (issueKey == null) {
Expand Down
20 changes: 13 additions & 7 deletions custom-vu/src/main/kotlin/jces1209/vu/action/WorkOnSearch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ class WorkOnSearch(
}

private fun openGlobalIssueSearch(): IssueNavigator {
meter.measure(
key = MeasureType.OPEN_GLOBAL_SEARCH,
action = {
jira.driver.navigate().to("/issues/")
issueNavigator.waitForNavigator()
}
)
val querryList: MutableList<String> = ArrayList()
querryList.add("/issues/?jql=order%20by%20created%20DESC")


querryList.forEach {
meter.measure(
key = MeasureType.OPEN_GLOBAL_SEARCH,
action = {
jira.navigateTo(it)
issueNavigator.waitForNavigator()
}
)
}
return issueNavigator
}

Expand Down
7 changes: 7 additions & 0 deletions custom-vu/src/main/kotlin/jces1209/vu/memory/Dashboard.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package jces1209.vu.memory

data class Dashboard(
val key: String,
val name: String
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package jces1209.vu.memory

import com.atlassian.performance.tools.jiraactions.api.SeededRandom
import com.atlassian.performance.tools.jiraactions.api.memories.Memory

class DashboardsMemory(
private val random: SeededRandom
) : Memory<Dashboard> {
private val dashboards = mutableSetOf<Dashboard>()

override fun recall(): Dashboard? {
if (dashboards.isEmpty()) {
return null
}
return random.pick(dashboards.toList())
}

override fun remember(memories: Collection<Dashboard>) {
dashboards.addAll(memories)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class JiraCloudWelcome(

fun skipToJira() = apply {
val questionSkip = By.xpath("//*[contains(text(), 'Skip question')]")
val projectsList = By.xpath("//*[@data-test-id=" +
"'global-pages.directories.directory-base.content.table.container']")
driver.wait(
or(
presenceOfElementLocated(By.id("jira")),
elementToBeClickable(questionSkip)
elementToBeClickable(questionSkip),
presenceOfElementLocated(projectsList)
)
)
repeat(2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DcBoardPage(
.wait(
ExpectedConditions.and(
visibilityOfElementLocated(By.id("ghx-detail-issue")),
visibilityOfElementLocated(By.className("issue-drop-zone"))
presenceOfElementLocated(By.className("issue-drop-zone"))
))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CloudDashboardPage(

waitForGadgetsLoad()
return dashboardName;

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@ class DcDashboardPage(
.wait(visibilityOfElementLocated(By.name("portalPageName")))
.sendKeys(dashboardName)
driver
.wait(
ExpectedConditions.elementToBeClickable(By.id("create_dashboard"))
).click()
driver.findElement(
By.id("edit-entity-dashboard-name"))
.sendKeys("TestDasboard" + System.currentTimeMillis())
driver.findElement(
By.id("edit-entity-submit"))
.findElement(By.cssSelector("#add-dashboard-submit, #edit-entity-submit"))
.click()

waitForDashboards()
return dashboardName;

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ class CloudProjectNavigatorPage(
private val jira: WebJira
) : ProjectNavigatorPage {


override fun openProject(projectKey: String): CloudProjectNavigatorPage {
jira.driver.navigate().to("/projects/")

jira.driver
.wait(ExpectedConditions
.elementToBeClickable(
.visibilityOfElementLocated(
By.xpath(
"//*[@data-test-id='global-pages.directories.directory-base.content.table.container']" +
"//*[@href='/browse/$projectKey']")))
.click()
"//*[contains(@href,'/browse/')]")))
jira.navigateTo("projects/$projectKey/issues")
waitForNavigator()
return this
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import org.openqa.selenium.support.ui.ExpectedConditions
class DcProjectNavigatorPage(
private val jira: WebJira
) : ProjectNavigatorPage {

override fun openProject(projectKey: String): DcProjectNavigatorPage {
jira.driver.navigate().to("/projects/")
jira.driver
.wait(ExpectedConditions
.elementToBeClickable(
By.xpath("(//*[@class='aui-page-panel-content']//*[@href='/browse/$projectKey'])")))
.click()
waitForNavigator()
return this
}

Expand Down
27 changes: 26 additions & 1 deletion src/test/kotlin/JiraPerformanceComparisonIT.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import com.atlassian.performance.tools.concurrency.api.AbruptExecutorService
import com.atlassian.performance.tools.concurrency.api.submitWithLogContext
import com.atlassian.performance.tools.io.api.ensureDirectory
import com.atlassian.performance.tools.jiraactions.api.ActionMetricStatistics
import com.atlassian.performance.tools.jiraactions.api.scenario.Scenario
import com.atlassian.performance.tools.report.api.FullReport
import com.atlassian.performance.tools.report.api.FullTimeline
import com.atlassian.performance.tools.report.api.WaterfallHighlightReport
import com.atlassian.performance.tools.report.api.action.SearchJqlReport
import com.atlassian.performance.tools.report.api.result.EdibleResult
import com.atlassian.performance.tools.report.api.result.RawCohortResult
import com.atlassian.performance.tools.virtualusers.api.VirtualUserOptions
Expand All @@ -16,19 +19,21 @@ import jces1209.SlowAndMeaningful
import jces1209.log.LogConfigurationFactory
import jces1209.vu.JiraCloudScenario
import jces1209.vu.JiraDcScenario
import jces1209.vu.PlaintextReport
import org.apache.logging.log4j.core.config.ConfigurationFactory
import org.junit.Test
import java.nio.file.Paths
import java.time.Duration
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors.newCachedThreadPool
import java.util.logging.Logger

class JiraPerformanceComparisonIT {

private val workspace = RootWorkspace(Paths.get("build")).currentTask
private val quality: BenchmarkQuality = SlowAndMeaningful.Builder().build()

private val logger = Logger.getLogger(JiraPerformanceComparisonIT::class.java.name)
init {
ConfigurationFactory.setConfigurationFactory(LogConfigurationFactory(workspace))
}
Expand All @@ -45,6 +50,8 @@ class JiraPerformanceComparisonIT {
.map { it.prepareForJudgement(FullTimeline()) }
}
FullReport().dump(results, workspace.isolateTest("Compare"))
planeTextReport(results,50)
planeTextReport(results,90)
dumpMegaSlowWaterfalls(results)
}

Expand All @@ -59,6 +66,24 @@ class JiraPerformanceComparisonIT {
benchmark(properties, scenario, quality)
}
}
private fun planeTextReport(results: List<EdibleResult>, persentile: Int){
results.forEach { result ->
val actionMetrics = result.actionMetrics
val cohortWorkspace = workspace.directory.resolve(result.cohort)
val report= PlaintextReport(
ActionMetricStatistics(result.actionMetrics)
).generate(persentile)
logger.info("Plain text report "+result.cohort+":\n$report")
SearchJqlReport(
allMetrics = actionMetrics
).report(cohortWorkspace)

WaterfallHighlightReport().report(
metrics = actionMetrics,
workspace = TestWorkspace(cohortWorkspace.resolve("WaterfallHighlight").ensureDirectory())
)
}
}

private fun benchmark(
properties: CohortProperties,
Expand Down
Loading