Skip to content
Merged
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
13 changes: 8 additions & 5 deletions core/server/metrics/format-converters.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import groupBy from 'lodash.groupby'

function promClientJsonToInfluxV2(metrics, extraLabels = {}) {
return metrics
.flatMap(metric => {
const valuesByLabels = groupBy(metric.values, value =>
JSON.stringify(Object.entries(value.labels).sort()),
)
const valuesByLabels = metric.values.reduce((acc, value) => {
const key = JSON.stringify(Object.entries(value.labels).sort())
if (!acc[key]) {
acc[key] = []
}
acc[key].push(value)
return acc
}, {})
return Object.values(valuesByLabels).map(metricsWithSameLabel => {
const labels = Object.entries(metricsWithSameLabel[0].labels)
.concat(Object.entries(extraLabels))
Expand Down
4 changes: 1 addition & 3 deletions core/service-test-runner/services-for-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* @module
*/

import difference from 'lodash.difference'

/**
* Given a pull request title like
* '[Travis Sonar] Support user token authentication'
Expand All @@ -27,7 +25,7 @@ function servicesForTitle(title) {
services = services.filter(Boolean).map(service => service.toLowerCase())

const ignored = ['wip', 'rfc', 'security']
return difference(services, ignored)
return services.filter(service => !ignored.includes(service))
}

export default servicesForTitle
3 changes: 2 additions & 1 deletion core/token-pooling/token-pool.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { expect } from 'chai'
import sinon from 'sinon'
import times from 'lodash.times'
import { Token, TokenPool } from './token-pool.js'

const times = (n, fn) => [...Array(n)].map(() => fn())

function expectPoolToBeExhausted(pool) {
expect(() => {
pool.next()
Expand Down
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
"js-yaml": "^4.1.0",
"jsonpath-plus": "^10.3.0",
"lodash.countby": "^4.6.0",
"lodash.groupby": "^4.6.0",
"lodash.times": "^4.3.2",
"matcher": "^6.0.0",
"mvncmp": "^1.0.0",
"node-env-flag": "^0.1.0",
Expand Down Expand Up @@ -185,7 +183,6 @@
"is-svg": "^6.1.0",
"jsdoc": "^4.0.4",
"lint-staged": "^16.2.3",
"lodash.difference": "^4.5.0",
"minimist": "^1.2.8",
"mocha": "^11.7.3",
"mocha-env-reporter": "^4.0.0",
Expand Down
Loading