[go-nuts] Re: Framework for application level metric in go

2016-11-25 Thread Victor Vrantchan
Take a look at the go-kit/kit/metrics package. 
https://godoc.org/github.com/go-kit/kit/metrics

The examples folder in the repo has some good usage examples with various 
metrics providers. 

On Friday, November 25, 2016 at 1:07:55 PM UTC-5, Parveen Kumar wrote:
>
> Hi Team,
>
> is there any tool or framework in golang which can be used to get 
> application level metrics like hit on api or turn around time, etc.
>
> Regards,
> Parveen Kumar
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: net/http and errors.

2016-11-25 Thread Victor Vrantchan
In Go, you can check if a type satisfies a particular behavior by declaring 
an interface, and then checking if the type satisfies that interface. 
In your case, you can check if the error is `Temporrary()` or not. 

See this snippet as an example: https://play.golang.org/p/Ffyg61iDpB

I 
recommend 
https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
 
and.or the GopherCon talk https://www.youtube.com/watch?v=lsBF58Q-DnY by 
Dave Cheney for a more in-depth presentation of this idea. 

On Friday, November 25, 2016 at 12:00:06 PM UTC-5, mb.dha...@gmail.com 
wrote:
>
> This is a question about the net/http API, Googling was not very helpful.
>
> _, err := http.Get("https://random_non_existing_domain.com;)
>
>
> Following code will obviously fail, but how can I check if it failed 
> because of DNS error not because a billion other things that might have 
> gone wrong?
>
> I tried this, (mostly as a shot in the dark)
>
> if e, ok := err.(net.Error); ok {
> fmt.Println("dial error", e.Temporary())
> }
> if e, ok := err.(*net.AddrError); ok {
> fmt.Println("addr rror", e.Temporary())
> }
> if e, ok := err.(*net.DNSError); ok {
> fmt.Println(e)
>
> and it seems to print 
>
>dial error false
>
> Is there any easy way to do what I'm trying to achieve?
>
> -
> dbalan
> @notmycommit
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-24 Thread Victor Vrantchan
I believe you can make a community private. The /r/golang name will be 
preserved, but no-one can access. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.