slogging time bug

Bug #901568 reported by peter.pang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Invalid
Undecided
Unassigned

Bug Description

i m in australia and my computer have to times:

localtime and UTC time

in slogging and swift code, all use gmtime to get the UTC time

but my localtime is different

so when i run swift stats collector program to calculate all the swift proxy log and account/container stats, i found that:

proxy log use UTC time , and account/container stats use localtime!!

so i change the access_processor.py like that:

        day, month, year, hour, minute, second = timestamp.split('/')
        month = ('%02s' % month_map.index(month)).replace(' ', '0')

        timestr = day+"/"+month+"/"+year+"/"+hour+"/"+minute+"/"+second
        timestr2 = "01/01/1970/00/0/0"

        timestr = time.mktime(time.strptime(timestr, "%d/%m/%Y/%H/%M/%S"))
        timestr2 = time.mktime(time.strptime(timestr2, "%d/%m/%Y/%H/%M/%S"))

        timestr = time.localtime(timestr - timestr2)

        timestamp = time.strftime("%d/%m/%Y/%H/%M/%S", timestr)
        day, month, year, hour, minute, second = timestamp.split('/')

that can change the proxy log time to localtime , so that can make sure the calculate result is correct!

Monty Taylor (mordred)
affects: openstack-ci → swift
Revision history for this message
John Dickinson (notmyname) wrote :

slogging is no longer part of swift itself. it is now a separate project, found here https://github.com/notmyname/slogging

Changed in swift:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.