(t *testing.T)
| 393 | } |
| 394 | |
| 395 | func TestRenderTreeWithStats(t *testing.T) { |
| 396 | for _, test := range []struct { |
| 397 | title string |
| 398 | plan *spanner.QueryPlan |
| 399 | want []QueryPlanRow |
| 400 | }{ |
| 401 | { |
| 402 | title: "Simple Query", |
| 403 | plan: &spanner.QueryPlan{ |
| 404 | PlanNodes: []*spanner.PlanNode{ |
| 405 | { |
| 406 | Index: 0, |
| 407 | ChildLinks: []*spanner.PlanNode_ChildLink{ |
| 408 | {ChildIndex: 1}, |
| 409 | }, |
| 410 | DisplayName: "Distributed Union", |
| 411 | Kind: spanner.PlanNode_RELATIONAL, |
| 412 | ExecutionStats: mustNewStruct(map[string]interface{}{ |
| 413 | "latency": map[string]interface{}{"total": "1", "unit": "msec"}, |
| 414 | "rows": map[string]interface{}{"total": "9"}, |
| 415 | "execution_summary": map[string]interface{}{"num_executions": "1"}, |
| 416 | }), |
| 417 | }, |
| 418 | { |
| 419 | Index: 1, |
| 420 | ChildLinks: []*spanner.PlanNode_ChildLink{ |
| 421 | {ChildIndex: 2}, |
| 422 | }, |
| 423 | DisplayName: "Distributed Union", |
| 424 | Kind: spanner.PlanNode_RELATIONAL, |
| 425 | Metadata: mustNewStruct(map[string]interface{}{"call_type": "Local"}), |
| 426 | ExecutionStats: mustNewStruct(map[string]interface{}{ |
| 427 | "latency": map[string]interface{}{"total": "1", "unit": "msec"}, |
| 428 | "rows": map[string]interface{}{"total": "9"}, |
| 429 | "execution_summary": map[string]interface{}{"num_executions": "1"}, |
| 430 | }), |
| 431 | }, |
| 432 | { |
| 433 | Index: 2, |
| 434 | ChildLinks: []*spanner.PlanNode_ChildLink{ |
| 435 | {ChildIndex: 3}, |
| 436 | }, |
| 437 | DisplayName: "Serialize Result", |
| 438 | Kind: spanner.PlanNode_RELATIONAL, |
| 439 | ExecutionStats: mustNewStruct(map[string]interface{}{ |
| 440 | "latency": map[string]interface{}{"total": "1", "unit": "msec"}, |
| 441 | "rows": map[string]interface{}{"total": "9"}, |
| 442 | "execution_summary": map[string]interface{}{"num_executions": "1"}, |
| 443 | }), |
| 444 | }, |
| 445 | { |
| 446 | Index: 3, |
| 447 | DisplayName: "Scan", |
| 448 | Kind: spanner.PlanNode_RELATIONAL, |
| 449 | Metadata: mustNewStruct(map[string]interface{}{"scan_type": "IndexScan", "scan_target": "SongsBySingerAlbumSongNameDesc", "Full scan": "true"}), |
| 450 | ExecutionStats: mustNewStruct(map[string]interface{}{ |
| 451 | "latency": map[string]interface{}{"total": "1", "unit": "msec"}, |
| 452 | "rows": map[string]interface{}{"total": "9"}, |
nothing calls this directly
no test coverage detected