我想将所有类型保存在一个名为"BenchmarkDataset"的集合中。我需要以不同的方式声明子类型(LatData、AggregateData、MetaData(,还是只需要接受为每种类型都有一个集合?
非常感谢您的帮助。
这是我生成的模式:
type LatData {
LatResults: [[Int ]]
LatResultSize: [Int ]
}
type AggregateData {
EVRCounter: Int
EVRLatencyTotal: Int
EVRLatencyAverage: Float
LatTestCount: Int
LatencyTotal: Int
LatencyAverage: Float
}
type MetaData {
StartTimeUTC: String
EndTimeUTC: String
StartTimeLocal: String
EndTimeLocal: String
}
type BenchmarkDataset {
LatData: LatData
AggregateData: AggregateData
MetaData: MetaData
}
type Query {
allBenchmarkDatasets: [BenchmarkDataset!]
}
这是我想插入的数据";基准数据集":
{
"MetaData" :
{
"StartTimeUTC" : "Sun Oct 18 21:41:38 2020n",
"EndTimeUTC" : "Sun Oct 18 21:45:38 2020n",
"StartTimeLocal" : "Sun Oct 18 16:41:38 2020n",
"EndTimeLocal" : "Sun Oct 18 16:45:38 2020n"
},
"AggregateData" :
{
"EVRCounter" : 3,
"EVRLatencyTotal" : 70,
"EVRLatencyAverage" : 23.333333333333332,
"LatTestCount" : 159,
"LatencyTotal" : 11871,
"LatencyAverage" : 74.660377358490564
},
"LatData" :
{
"LatResultSize" :
[
4,
4,
4
],
"LatResults" :
[
[
0,
2,
"zoom",
"latencymonitor"
],
[
1,
1,
"zoom",
"latencymonitor"
],
[
2,
1,
"zoom",
"latencymonitor"
],
[
3,
1,
"dota2",
"dota2"
]
]
}
}
此外,我知道我的数据格式不好(特别是包含2个int和2个字符串的2d"LatData"数组(,任何数据格式提示也值得赞赏。
解决了问题!我特别需要使用"@嵌入的";使我的模式看起来像这样的指令:
type LatData @embedded {
LatResults: [[Int ]]
LatResultSize: [Int ]
}
type AggregateData @embedded {
EVRCounter: Int
EVRLatencyTotal: Int
EVRLatencyAverage: Float
LatTestCount: Int
LatencyTotal: Int
LatencyAverage: Float
}
type MetaData @embedded {
StartTimeUTC: String
EndTimeUTC: String
StartTimeLocal: String
EndTimeLocal: String
}
type BenchmarkDataset {
LatData: LatData
AggregateData: AggregateData
MetaData: MetaData
}
type Query {
allBenchmarkDatasets: [BenchmarkDataset!]
}