import request from '@/utils/request'
import Request from '@/utils/requestOther'
const instance = new Request('/app')
// 修正版
export function traceList(data) {
  return request({
    url: '/api/v1/trace',
    method: 'get',
    params: data
  })
}
export function traceDetail(id, data) {
  return request({
    url: '/api/v1/trace/tree/' + id,
    method: 'get',
    params: data
  })
}

export function traceGraph(id) {
  return request({
    url: '/api/v1/trace/graph/' + id,
    method: 'get'
  })
}

// 用于动态拓扑基础设施层 /api/v1/trace/dbslowtop
export function dbslowtop(query) {
  return request({
    url: '/api/v1/trace/dbslowtop',
    method: 'get',
    params: query
  })
}

// 用于span
export function networkSpans(data) {
  const url = '/v1/stats/querier/network-spans'
  return instance.post(url, data)
}
// 获取火焰图数据
export function getFlameData(data) {
  const url = '/v1/stats/querier/trace/complation'
  return instance.post(url, data)
}
