fix: intrument os.OpenFile differently for Reads and Writes (#15449)

allows us to trace latency for READs or WRITEs
This commit is contained in:
Harshavardhana
2022-08-01 13:22:43 -07:00
committed by GitHub
parent aad9cb208a
commit 043aaa792d
8 changed files with 43 additions and 36 deletions

View File

@@ -237,7 +237,7 @@ func (jd *tierDiskJournal) Open() error {
}
var err error
jd.file, err = os.OpenFile(jd.JournalPath(), os.O_APPEND|os.O_CREATE|os.O_WRONLY|writeMode, 0o666)
jd.file, err = OpenFile(jd.JournalPath(), os.O_APPEND|os.O_CREATE|os.O_WRONLY|writeMode, 0o666)
if err != nil {
return err
}
@@ -259,7 +259,7 @@ func (jd *tierDiskJournal) Open() error {
}
func (jd *tierDiskJournal) OpenRO() (io.ReadCloser, error) {
file, err := os.Open(jd.ReadOnlyPath())
file, err := Open(jd.ReadOnlyPath())
if err != nil {
return nil, err
}