MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / LogRecords

Method LogRecords

log-driver/loki/loki.go:161–177  ·  view source on GitHub ↗
(clusterId string, start time.Time, end time.Time)

Source from the content-addressed store, hash-verified

159}
160
161func (d *Driver) LogRecords(clusterId string, start time.Time, end time.Time) ([]*log_driver.LogItem, error) {
162 if start.After(end) {
163 return nil, fmt.Errorf("start time is greater than end time")
164 }
165 queries := url.Values{}
166 queries.Set("query", fmt.Sprintf("{cluster=\"%s\"} | json", clusterId))
167 queries.Set("direction", "backward")
168 queries.Set("start", strconv.FormatInt(start.UnixNano(), 10))
169 queries.Set("end", strconv.FormatInt(end.UnixNano(), 10))
170 log.Debug("query is ", queries.Get("query"))
171 logs, err := d.recuseLogs(queries, end, 1)
172 if err != nil {
173 return nil, err
174 }
175
176 return logs, nil
177}
178
179func (d *Driver) Logs(clusterId string, conditions map[string]string, start time.Time, end time.Time, limit int64, offset int64) ([]*log_driver.LogItem, int64, error) {
180 if start.After(end) {

Callers

nothing calls this directly

Calls 3

recuseLogsMethod · 0.95
SetMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected