mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 04:49:05 +01:00
Allow CORS credentials; cpu->hwthread for cc-metric-store
This commit is contained in:
parent
d4b1b32ca0
commit
aac19c938f
@ -399,7 +399,8 @@ func main() {
|
|||||||
r.Use(handlers.CompressHandler)
|
r.Use(handlers.CompressHandler)
|
||||||
r.Use(handlers.RecoveryHandler(handlers.PrintRecoveryStack(true)))
|
r.Use(handlers.RecoveryHandler(handlers.PrintRecoveryStack(true)))
|
||||||
r.Use(handlers.CORS(
|
r.Use(handlers.CORS(
|
||||||
handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization"}),
|
handlers.AllowCredentials(),
|
||||||
|
handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization", "Origin"}),
|
||||||
handlers.AllowedMethods([]string{"GET", "POST", "HEAD", "OPTIONS"}),
|
handlers.AllowedMethods([]string{"GET", "POST", "HEAD", "OPTIONS"}),
|
||||||
handlers.AllowedOrigins([]string{"*"})))
|
handlers.AllowedOrigins([]string{"*"})))
|
||||||
handler := handlers.CustomLoggingHandler(io.Discard, r, func(_ io.Writer, params handlers.LogFormatterParams) {
|
handler := handlers.CustomLoggingHandler(io.Discard, r, func(_ io.Writer, params handlers.LogFormatterParams) {
|
||||||
|
@ -239,7 +239,7 @@ func (ccms *CCMetricStore) LoadData(job *schema.Job, metrics []string, scopes []
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
hwthreadString = string("cpu") // TODO/FIXME: inconsistency between cc-metric-collector and ClusterCockpit
|
hwthreadString = string(schema.MetricScopeHWThread)
|
||||||
coreString = string(schema.MetricScopeCore)
|
coreString = string(schema.MetricScopeCore)
|
||||||
memoryDomainString = string(schema.MetricScopeMemoryDomain)
|
memoryDomainString = string(schema.MetricScopeMemoryDomain)
|
||||||
socketString = string(schema.MetricScopeSocket)
|
socketString = string(schema.MetricScopeSocket)
|
||||||
@ -266,6 +266,10 @@ func (ccms *CCMetricStore) buildQueries(job *schema.Job, metrics []string, scope
|
|||||||
scopesLoop:
|
scopesLoop:
|
||||||
for _, requestedScope := range scopes {
|
for _, requestedScope := range scopes {
|
||||||
nativeScope := mc.Scope
|
nativeScope := mc.Scope
|
||||||
|
if nativeScope == schema.MetricScopeAccelerator && job.NumAcc == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
scope := nativeScope.Max(requestedScope)
|
scope := nativeScope.Max(requestedScope)
|
||||||
for _, s := range handledScopes {
|
for _, s := range handledScopes {
|
||||||
if scope == s {
|
if scope == s {
|
||||||
|
Loading…
Reference in New Issue
Block a user