Доработать инструменты экспериментов: чередовать повторы, останавливать лестницу на первой проваленной ступени, задавать maxconn и CPU базы в сериях, записывать замер скорости хоста и контроль шума, сократить комментарии
This commit is contained in:
@@ -52,9 +52,8 @@ func (c *client) postMessage(chatID, token, text string, out any) error {
|
||||
return c.do(req, token, http.StatusCreated, out)
|
||||
}
|
||||
|
||||
// sendWithKey sends one attempt of a message under the given key on a
|
||||
// connection of its own and reports the status, the message (on 201) and the
|
||||
// replica that answered.
|
||||
// sendWithKey sends one attempt on a connection of its own, so that the
|
||||
// attempts of one key reach different replicas.
|
||||
func (c *client) sendWithKey(chatID, token, key, text string) (int, chat.MessageResponse, string, error) {
|
||||
var msg chat.MessageResponse
|
||||
raw, err := json.Marshal(map[string]string{"text": text})
|
||||
|
||||
@@ -4,12 +4,9 @@
|
||||
// then the history is paged and must contain exactly N*M unique messages in
|
||||
// id order.
|
||||
//
|
||||
// Phase 2, shared idempotency: in each of K rounds one user sends the same
|
||||
// message with the same Idempotency-Key P times in parallel, each attempt on
|
||||
// its own connection, so the balancer spreads them over the replicas. Every
|
||||
// attempt must answer 201 with the same message, the attempts must have
|
||||
// reached at least two replicas, the history must hold exactly K messages,
|
||||
// and the key with another text must answer 409.
|
||||
// Phase 2: in each of K rounds one key is sent P times in parallel through the
|
||||
// balancer; every attempt must get 201 with one message, at least two replicas
|
||||
// must answer, the history must hold K messages, and another text must get 409.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user