Jiri Simsa | 756772c | 2015-03-25 15:40:54 -0700 | [diff] [blame^] | 1 | // Copyright 2015 The Vanadium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
Jungho Ahn | 48d4307 | 2015-02-23 18:50:27 -0800 | [diff] [blame] | 5 | package stress |
| 6 | |
| 7 | import ( |
| 8 | "v.io/v23/services/security/access" |
| 9 | ) |
| 10 | |
| 11 | type Arg struct { |
| 12 | ABool bool |
| 13 | AInt64 int64 |
| 14 | AListOfBytes []byte |
| 15 | } |
| 16 | |
| 17 | type Stats struct { |
| 18 | SumCount uint64 |
| 19 | SumStreamCount uint64 |
| 20 | } |
| 21 | |
| 22 | type Stress interface { |
| 23 | // Do returns the checksum of the payload that it receives. |
| 24 | Sum(arg Arg) ([]byte | error) {access.Read} |
| 25 | |
| 26 | // DoStream returns the checksum of the payload that it receives via the stream. |
| 27 | SumStream() stream<Arg,[]byte> error {access.Read} |
| 28 | |
| 29 | // GetStats returns the stats on the calls that the server received. |
| 30 | GetStats() (Stats | error) {access.Read} |
| 31 | |
| 32 | // Stop stops the server. |
| 33 | Stop() error {access.Admin} |
| 34 | } |