Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate Latency precision in long running request #1830

Merged
merged 1 commit into from Mar 28, 2019

Conversation

dmarkham
Copy link
Contributor

fixes #1823

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #1830 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1830      +/-   ##
==========================================
+ Coverage   98.64%   98.64%   +<.01%     
==========================================
  Files          41       41              
  Lines        2146     2148       +2     
==========================================
+ Hits         2117     2119       +2     
  Misses         18       18              
  Partials       11       11
Impacted Files Coverage Δ
logger.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d462bb...b5e73d3. Read the comment docs.

@thinkerou
Copy link
Member

@dmarkham my case:

[GIN] 2019/03/28 - 07:30:32 | 200 |  8.005575187s |             ::1 | GET      /1
[GIN] 2019/03/28 - 07:31:57 | 200 | 1m20.000219731s |             ::1 | GET      /2

my code:

	r.GET("/1", func(c *gin.Context) {
		time.Sleep(time.Duration(8)*time.Second)
		c.JSON(200, gin.H{"msg": "hi"})
	})

	r.GET("/2", func(c *gin.Context) {
		time.Sleep(time.Duration(80)*time.Second)
		c.JSON(200, gin.H{"msg": "hi"})
	})

@dmarkham
Copy link
Contributor Author

@dmarkham my case:

[GIN] 2019/03/28 - 07:30:32 | 200 |  8.005575187s |             ::1 | GET      /1
[GIN] 2019/03/28 - 07:31:57 | 200 | 1m20.000219731s |             ::1 | GET      /2

my code:

	r.GET("/1", func(c *gin.Context) {
		time.Sleep(time.Duration(8)*time.Second)
		c.JSON(200, gin.H{"msg": "hi"})
	})

	r.GET("/2", func(c *gin.Context) {
		time.Sleep(time.Duration(80)*time.Second)
		c.JSON(200, gin.H{"msg": "hi"})
	})

@dmarkham dmarkham closed this Mar 28, 2019
@dmarkham dmarkham reopened this Mar 28, 2019
@dmarkham
Copy link
Contributor Author

dmarkham commented Mar 28, 2019

@thinkerou My results look like yours when I tested on master..

[GIN] 2019/03/27 - 18:04:41 | 200 |  8.000501674s |             ::1 | GET      /8
[GIN] 2019/03/27 - 18:06:05 | 200 | 1m5.000277466s |             ::1 | GET      /65

but whan I tested on my pulled request sha b5e73d32d8c6c9acfabc5c39e3903e2f9f40161a it worked nicely for things over 1m. Can you please double check you were running the code from this pull request in your test.

[GIN] 2019/03/27 - 18:12:14 | 200 |  8.000517544s |             ::1 | GET      /8
[GIN] 2019/03/27 - 18:12:57 | 200 |          1m5s |             ::1 | GET      /65

@thinkerou
Copy link
Member

@dmarkham Oh sorry, I miss some code, you are right. thanks!

@thinkerou thinkerou added this to the 1.4 milestone Mar 28, 2019
Copy link
Contributor

@sairoutine sairoutine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great works!

@thinkerou thinkerou merged commit ce20f10 into gin-gonic:master Mar 28, 2019
ez-max added a commit to ez-max/gin that referenced this pull request Mar 29, 2019
Truncate Latency precision in long running request (gin-gonic#1830)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styling breaks when request takes long
3 participants