Skip to content

Commit

Permalink
Merge pull request #314 from eazence/issue_313
Browse files Browse the repository at this point in the history
feat: Turbo编译加速变更MQ的exchange #313
  • Loading branch information
foxdd authored Nov 6, 2024
2 parents 32b710e + e2a0dfb commit b7a4eba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.tencent.devops.turbo.model.TTurboDaySummaryEntity
import com.tencent.devops.turbo.pojo.TurboDaySummaryOverviewModel
import org.bson.Document
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.domain.Sort
import org.springframework.data.mongodb.core.FindAndModifyOptions
import org.springframework.data.mongodb.core.MongoTemplate
import org.springframework.data.mongodb.core.aggregation.Aggregation
Expand Down Expand Up @@ -144,8 +145,9 @@ class TurboSummaryDao @Autowired constructor(

val skip = Aggregation.skip((pageNum * pageSize).toLong())
val limit = Aggregation.limit(pageSize.toLong())
val sort = Aggregation.sort(Sort.Direction.ASC, "_id")

val aggregation = Aggregation.newAggregation(match, group, skip, limit)
val aggregation = Aggregation.newAggregation(match, group, sort, skip, limit)
val queryResults: AggregationResults<TurboDaySummaryOverviewModel> =
mongoTemplate.aggregate(aggregation, "t_turbo_day_summary_entity", TurboDaySummaryOverviewModel::class.java)
return queryResults.mappedResults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ class BkMetricsDailyJob @Autowired constructor(
turboSaveTime = saveTime
)

bkMetricsRabbitTemplate.convertAndSend(EXCHANGE_METRICS_STATISTIC_TURBO_DAILY, "",
JsonUtil.toJson(bkMetricsMessage)) { message: Message ->
val messageProperties = message.messageProperties
messageProperties.setHeader("contentType", "application/json")
messageProperties.setHeader("contentEncoding", "UTF-8")
messageProperties.deliveryMode = MessageDeliveryMode.PERSISTENT
message
}
bkMetricsRabbitTemplate.convertAndSend(EXCHANGE_METRICS_STATISTIC_TURBO_DAILY, "", bkMetricsMessage)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const val ROUTE_TURBO_PLUGIN_DATA = "route.turbo.plugin.data.new"
/**
* 蓝盾度量数据上报
*/
const val EXCHANGE_METRICS_STATISTIC_TURBO_DAILY = "e.metrics.statistic.turbo.daily"
const val EXCHANGE_METRICS_STATISTIC_TURBO_DAILY = "metrics.statistic.turbo.daily"

/**
* 蓝盾项目停用广播通知
Expand Down

0 comments on commit b7a4eba

Please sign in to comment.