You are viewing a single comment's thread from:

RE: Patroneos: Code Analysis, Benchmark results, Operation and Implementation Recommendations

in #en6 years ago

Hi, @chrisallnutt! We really appreciate you for fixing issue #26.

We used dummy endpoint below with changing latency value in time.Sleep for lab benchmark.

package main

import (
   "fmt"
   "log"
   "net/http"
   "time"
   "runtime"
   "io/ioutil"
)

func main() {
   runtime.GOMAXPROCS(1)
   http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
       if len(r.FormValue("case-two")) > 0 {
           fmt.Println("case two")
       } else {
           time.Sleep(time.Millisecond * 100)
           b, err := ioutil.ReadAll(r.Body)
           if err != nil {
               log.Fatal(err)
           }
           fmt.Println(b)
           //fmt.Println("case one end")
       }
   })

   if err := http.ListenAndServe(":8000", nil); err != nil {
       log.Fatal(err)
   }
}