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

Purge old Rendered Templates #2167

Merged
merged 11 commits into from Oct 18, 2017

Conversation

Projects
None yet
2 participants
@kylebrandt
Member

kylebrandt commented Sep 29, 2017

No description provided.

captncraig added some commits Sep 25, 2017

initial base logic for removing old templates $ redis-cli info | grep…
… used

used_memory:7078922104
used_memory_human:6.59G
used_memory_rss:7078863208
used_memory_rss_human:6.59G
used_memory_peak:15792637592
used_memory_peak_human:14.71G
used_memory_lua:37888
used_memory_lua_human:37.00K
used_cpu_sys:261.25
used_cpu_user:139.53
used_cpu_sys_children:0.00
used_cpu_user_children:0.00
continue
}
fmt.Println(st.Id, len(st.Events), st.Open)
s, err := redis.String(myConn.Do("GET", fmt.Sprintf("renderedTemplatesById:%d", st.Id)))

This comment has been minimized.

@kylebrandt

kylebrandt Sep 29, 2017

Member

renderedTemplatesKey(st.Id)

@captncraig captncraig changed the title from WIP: Purge old Templates to Purge old Rendered Templates Oct 10, 2017

captncraig added some commits Oct 10, 2017

}
state, err := d.getIncident(id, conn)
if err != nil {
if strings.Contains(err.Error(), "nil returned") {

This comment has been minimized.

@kylebrandt

kylebrandt Oct 10, 2017

Member

strings.Contains on error, combined with the match not being a constant doesn't seem safe in the long run.

This comment has been minimized.

@captncraig

captncraig Oct 13, 2017

Contributor

Yeah, the problem there is that the error will already be wrapped at that point, and the inner error is not accessible. I guess I can also make a package function for that test though.

//ledis uses XSCAN cursor "KV" MATCH foo
//redis uses SCAN cursor MATCH foo
cmd := "SCAN"

This comment has been minimized.

@kylebrandt

kylebrandt Oct 10, 2017

Member

Maybe Redis and Ledis SCAN could be a function outside of this that can be reused (and make this func shorter)

This comment has been minimized.

@captncraig

captncraig Oct 13, 2017

Contributor

Yeah, we did that with some others, but the re-ordering of the args makes it tricky. I will factor out.

@kylebrandt

This comment has been minimized.

Member

kylebrandt commented Oct 18, 2017

@captncraig Didn't find any problems testing this out, but needs conflicts resolved.

@kylebrandt kylebrandt merged commit 3866edf into master Oct 18, 2017

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
bosun All checks Passed!
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment