Description:
In various places in the Monitor web interface, we have From/To date fields which the user enters in their locale/timezone. We then either parse the date strings into value using either SimpleDateformat.parse() in the server's timezone (com.mysql.merlin.ui.actions.monitor.Graph) or explictly as UTC (callers of DateUtil.toDate(), see below).
Callers of DateUtil.toDate:
[-] Date com.mysql.util.DateUtil.toDate(String)
|-[+] com.mysql.util.DateUtil
|-[+] <void> com.mysql.merlin.ui.actions.monitor.queryAnalysis.BrowseQueries.addSummaries():576
|-[+] <void> com.mysql.merlin.ui.actions.monitor.queryAnalysis.BrowseQueries.addSummaries():578 TODO
|-[-] Date com.mysql.util.DateUtil.toDateNotNull(String):104
| |-[+] com.mysql.util.DateUtil
| |-[+] Date com.mysql.merlin.server.collect.DCAgentDatumXMLWrapper.getUtc():51
| |-[+] <void> com.mysql.util.SerializedXML.setField(Serializable,Node):215
| |-[X] Date com.mysql.merlin.ui.actions.settings.logs.ShowLog.convertUtc(String):287
| `-[+] Date com.mysql.etools.monitor.bo.MockFlaggedStatement.getTime():51
|-[+] Date com.mysql.etools.monitor.rest.HttpRequest.getTimestamp():101
|-[+] <void> com.mysql.etools.monitor.bo.Agent.updateFromHeartbeat(AgentHeartbeatRequest):279
|-[-] <void> com.mysql.etools.monitor.bo.quanal.StatementFilter.setFromDate(String):150
| |-[+] com.mysql.etools.monitor.bo.quanal.StatementFilter
| `-[+] String com.mysql.merlin.ui.actions.monitor.queryAnalysis.BrowseQueries.executeInner():479
|-[-] <void> com.mysql.etools.monitor.bo.quanal.StatementFilter.setToDate(String):162
| |-[+] com.mysql.etools.monitor.bo.quanal.StatementFilter
| `-[+] String com.mysql.merlin.ui.actions.monitor.queryAnalysis.BrowseQueries.executeInner():482
|-[-] <void> com.mysql.merlin.ui.actions.monitor.events.Events.updateAlarms():328
| |-[+] com.mysql.merlin.ui.actions.monitor.events.Events
| `-[+] String com.mysql.merlin.ui.actions.monitor.events.Events.executeInner():483
|-[-] <void> com.mysql.merlin.ui.actions.monitor.events.Events.updateAlarms():334
| |-[+] com.mysql.merlin.ui.actions.monitor.events.Events
| `-[+] String com.mysql.merlin.ui.actions.monitor.events.Events.executeInner():483
|-[-] String com.mysql.merlin.ui.actions.settings.logs.ShowLog.executeInner():326
| |-[+] com.mysql.merlin.ui.actions.BaseViewAction
| `-[+] String com.mysql.merlin.ui.actions.BaseViewAction.execute():16
|-[-] String com.mysql.merlin.ui.actions.settings.logs.ShowLog.executeInner():331
| |-[+] com.mysql.merlin.ui.actions.BaseViewAction
| `-[+] String com.mysql.merlin.ui.actions.BaseViewAction.execute():16
|-[-] String com.mysql.merlin.server.MainCommandProcessor.getLog(Map):262
| |-[+] com.mysql.merlin.server.MainCommandProcessor
| `-[+] Serializable com.mysql.merlin.server.MainCommandProcessor.processRequest(User,Map):97
|-[-] String com.mysql.merlin.server.MainCommandProcessor.getLog(Map):263
| |-[+] com.mysql.merlin.server.MainCommandProcessor
| `-[+] Serializable com.mysql.merlin.server.MainCommandProcessor.processRequest(User,Map):97
`-[-] Date com.mysql.etools.monitor.rest.GraphReportResource.argToDate(Matcher,int):95
|-[+] com.mysql.etools.monitor.rest.GraphReportResource
|-[+] <void> com.mysql.etools.monitor.rest.GraphReportResource.GraphReportResource(String,Clock,Map):85
`-[+] <void> com.mysql.etools.monitor.rest.GraphReportResource.GraphReportResource(String,Clock,Map):88
How to repeat:
For the Graphs issue (easiest to see evidence of):
run your server and agent in EST. Make your user setting for PST. Go to graphs page; change to From/To, 9-10am. Notice that the graph axis is "6-7am" on the graph, but it's really the data for 9-10am EST.
Suggested fix:
Use the user's timezone to parse the dates, traffic only in UTC timestamps/Dates internally.