Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: perf/server/src/types/types.go

Issue 382313002: Adds tile handler to the perf server (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 package types 1 package types
2 2
3 import ( 3 import (
4 "time" 4 "time"
5 ) 5 )
6 6
7 import ( 7 import (
8 "config" 8 "config"
9 ) 9 )
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // NewTile returns an new Tile object ready to be filled with data via populate( ). 80 // NewTile returns an new Tile object ready to be filled with data via populate( ).
81 func NewTile() *Tile { 81 func NewTile() *Tile {
82 return &Tile{ 82 return &Tile{
83 Traces: make([]*Trace, 0), 83 Traces: make([]*Trace, 0),
84 ParamSet: make(map[string]Choices), 84 ParamSet: make(map[string]Choices),
85 Commits: make([]*Commit, 0), 85 Commits: make([]*Commit, 0),
86 } 86 }
87 } 87 }
88 88
89 type TraceGUI struct {
jcgregorio 2014/07/11 19:03:56 Add doc comment on where this is used.
kelvinly 2014/07/11 19:42:30 Done.
90 Data [][2]float64 `json:"data_ui"`
jcgregorio 2014/07/11 19:03:56 Just "data" and "key" for the json should be fine.
kelvinly 2014/07/11 19:42:30 Done.
91 Key string `json:"key_ui"`
jcgregorio 2014/07/11 19:03:56 Run gofmt over all the code.
kelvinly 2014/07/11 19:42:30 Done.
92 }
93
94 type TileGUI struct {
jcgregorio 2014/07/11 19:03:56 Add doc comment on where this is used.
kelvinly 2014/07/11 19:42:30 Done.
95 Traces []TraceGUI `json:"traces,omitempty"`
96 ParamSet [][]string `json:"params,omitempty"`
97 Commits []*Commit `json:"commits,omitempty"`
98 NameList []string `json:"names,omitempty"`
99 Scale int `json:"scale"`
100 TileIndex int `json:"tileIndex"`
101 }
102
103 func NewGUITile(scale int, tileIndex int) *TileGUI {
104 return &TileGUI {
105 Traces: make([]TraceGUI, 0),
106 ParamSet: make([][]string, 0),
107 Commits: make([]*Commit, 0),
108 Scale: scale,
109 TileIndex: tileIndex,
110 }
111 }
112
89 // TileStore is an interface representing the ability to save and restore Tiles. 113 // TileStore is an interface representing the ability to save and restore Tiles.
90 type TileStore interface { 114 type TileStore interface {
91 Put(scale, index int, tile *Tile) error 115 Put(scale, index int, tile *Tile) error
92 116
93 // Get returns the Tile for a given scale and index. Pass in -1 for inde x to 117 // Get returns the Tile for a given scale and index. Pass in -1 for inde x to
94 // get the last tile for a given scale. Each tile contains its tile inde x and 118 // get the last tile for a given scale. Each tile contains its tile inde x and
95 // scale. Get returns (nil, nil) if you pass in -1 and there is no data in 119 // scale. Get returns (nil, nil) if you pass in -1 and there is no data in
96 // the store yet. 120 // the store yet.
97 Get(scale, index int) (*Tile, error) 121 Get(scale, index int) (*Tile, error)
98 } 122 }
(...skipping 19 matching lines...) Expand all
118 return true 142 return true
119 } 143 }
120 i.day = i.day.Add(-24 * time.Hour) 144 i.day = i.day.Add(-24 * time.Hour)
121 return i.Date() != config.BEGINNING_OF_TIME.BqTableSuffix() 145 return i.Date() != config.BEGINNING_OF_TIME.BqTableSuffix()
122 } 146 }
123 147
124 // Date returns the day formatted as we use them on BigQuery table name suffixes . 148 // Date returns the day formatted as we use them on BigQuery table name suffixes .
125 func (i *DateIter) Date() string { 149 func (i *DateIter) Date() string {
126 return i.day.Format("20060102") 150 return i.day.Format("20060102")
127 } 151 }
OLDNEW
« perf/server/src/server/perf.go ('K') | « perf/server/src/server/perf.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698