added a /api/metrics/test query that returns random walk series

This commit is contained in:
Torkel Ödegaard
2015-01-06 09:11:00 +01:00
parent 0e3f91508e
commit 3e07605260
4 changed files with 49 additions and 20 deletions
+9 -19
View File
@@ -19,25 +19,6 @@ type CurrentUser struct {
GravatarUrl string `json:"gravatarUrl"`
}
type AccountInfo struct {
Email string `json:"email"`
Name string `json:"name"`
Collaborators []*Collaborator `json:"collaborators"`
}
type OtherAccount struct {
Id int64 `json:"id"`
Name string `json:"name"`
Role string `json:"role"`
IsUsing bool `json:"isUsing"`
}
type Collaborator struct {
AccountId int64 `json:"accountId"`
Email string `json:"email"`
Role string `json:"role"`
}
type DataSource struct {
Id int64 `json:"id"`
AccountId int64 `json:"accountId"`
@@ -51,6 +32,15 @@ type DataSource struct {
BasicAuth bool `json:"basicAuth"`
}
type MetricQueryResultDto struct {
Data []MetricQueryResultDataDto `json:"data"`
}
type MetricQueryResultDataDto struct {
Target string `json:"target"`
DataPoints [][2]float64 `json:"datapoints"`
}
func NewCurrentUser(account *models.Account) *CurrentUser {
model := &CurrentUser{}
if account != nil {