FAQ
Hi

I have a golang project that has a few layers (http, go-json-rest,
go-sql-driver/mysql). Inputs are received by the http layer, some analysis
is made, the parameters are passed to the db layer, after receiving the
query results from the db layer, the http response is written using the
go-json-rest library.

I have a binary which will do a stress test of about 1 million requests to
the above system. The stress test binary generates the cumulative time
taken for each response too.

However, on the server side, I want to profile the time taken by each of
the function in each of the layers. Using golang's built in pprof
integration, I can measure the CPU time. But I want to measure the actual
time taken for the response (without having to manually add a snippet
like http://blog.stathat.com/2012/10/10/time_any_function_in_go.html )

Are there any tools or pprof options or any other smarter way to capture
the physical world time spent in each place ?

Thanks.

Sankar

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ascesh dandey at Apr 12, 2016 at 1:50 pm
    +1 ..
    am also looking for something similar..
    maybe using go generate ??
    On Friday, January 23, 2015 at 10:58:07 AM UTC+5:30, Sankar wrote:

    Hi

    I have a golang project that has a few layers (http, go-json-rest,
    go-sql-driver/mysql). Inputs are received by the http layer, some analysis
    is made, the parameters are passed to the db layer, after receiving the
    query results from the db layer, the http response is written using the
    go-json-rest library.

    I have a binary which will do a stress test of about 1 million requests to
    the above system. The stress test binary generates the cumulative time
    taken for each response too.

    However, on the server side, I want to profile the time taken by each of
    the function in each of the layers. Using golang's built in pprof
    integration, I can measure the CPU time. But I want to measure the actual
    time taken for the response (without having to manually add a snippet like
    http://blog.stathat.com/2012/10/10/time_any_function_in_go.html )

    Are there any tools or pprof options or any other smarter way to capture
    the physical world time spent in each place ?

    Thanks.

    Sankar
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Steven Hartland at Apr 12, 2016 at 4:26 pm
    How about statsd e.g.
    https://godoc.org/gopkg.in/alexcesaro/statsd.v2

    You have to instrument you code e.g. adding the following at the top of
    each call you want to measure:

    defer c.NewTiming().Send("homepage.response_time")


    On 12/04/2016 14:31, ascesh dandey wrote:
    +1 ..
    am also looking for something similar..
    maybe using go generate ??

    On Friday, January 23, 2015 at 10:58:07 AM UTC+5:30, Sankar wrote:

    Hi

    I have a golang project that has a few layers (http, go-json-rest,
    go-sql-driver/mysql). Inputs are received by the http layer, some
    analysis is made, the parameters are passed to the db layer, after
    receiving the query results from the db layer, the http response
    is written using the go-json-rest library.

    I have a binary which will do a stress test of about 1 million
    requests to the above system. The stress test binary generates the
    cumulative time taken for each response too.

    However, on the server side, I want to profile the time taken by
    each of the function in each of the layers. Using golang's built
    in pprof integration, I can measure the CPU time. But I want to
    measure the actual time taken for the response (without having to
    manually add a snippet like
    http://blog.stathat.com/2012/10/10/time_any_function_in_go.html
    <http://blog.stathat.com/2012/10/10/time_any_function_in_go.html> )

    Are there any tools or pprof options or any other smarter way to
    capture the physical world time spent in each place ?

    Thanks.

    Sankar

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts+unsubscribe@googlegroups.com
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Apr 12, 2016 at 5:06 pm
    Il giorno martedì 12 aprile 2016 18:26:34 UTC+2, Steven Hartland ha scritto:
    How about statsd e.g.
    https://godoc.org/gopkg.in/alexcesaro/statsd.v2

    You have to instrument you code e.g. adding the following at the top of
    each call you want to measure:

    defer c.NewTiming().Send("homepage.response_time")

    Isn't it better to generate the required code, instead of having to
    manually instrument the original code?


    Manlio

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJan 23, '15 at 5:28a
activeApr 12, '16 at 5:06p
posts4
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase