These are chat archives for gin-gonic/gin

17th
Apr 2016
Ousmane Traore
@otraore
Apr 17 2016 00:05
This is the best I came with @riza (Keep in mind it just calculates how long it took the handler/controller to send a response and not the whole response time [look at my statement above for why]):
func getIndex(c *gin.Context) {
    start := time.Now()

    time.Sleep(1000) //Mimic db hit

    end := time.Now()

    latency := end.Sub(start)
    c.JSON(200, gin.H{
        "load": fmt.Sprintf("%13v", latency),
    })
}
Matthias Loibl
@metalmatze
Apr 17 2016 00:09
That's probably going to be what's taking the longest anyway. The DB.
Ousmane Traore
@otraore
Apr 17 2016 00:09
It'd be simpler to log how long a db hit took
And yeah I completely agree @MetalMatze
Rıza Sabuncu
@riza
Apr 17 2016 21:26
Hei
I have many mongodb docs,
and haves docs html content
how to bind in template html content?
on laravel {!! $variable !!}
i want proccess html tags
Ousmane Traore
@otraore
Apr 17 2016 23:50
@riza Can I see your template and handler/controller?