- Sort Score
- Result 10 results
- Languages All
Results 151 - 160 of 1,446 for time (0.08 sec)
-
docs_src/middleware/tutorial001.py
import time from fastapi import FastAPI, Request app = FastAPI() @app.middleware("http") async def add_process_time_header(request: Request, call_next): start_time = time.perf_counter() response = await call_next(request) process_time = time.perf_counter() - start_time response.headers["X-Process-Time"] = str(process_time)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 13:46:39 UTC 2024 - 365 bytes - Viewed (0) -
cmd/xl-storage-disk-id-check.go
// Offset checks a bit. time.Sleep(time.Duration(rng.Int63n(int64(1 * time.Second)))) dctx, dcancel := context.WithCancel(ctx) started := time.Now() go func() { timeout := time.NewTimer(globalDriveConfig.GetMaxTimeout()) select { case <-dctx.Done(): if !timeout.Stop() { <-timeout.C } case <-timeout.C: spent := time.Since(started)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Oct 26 09:56:26 UTC 2024 - 34.5K bytes - Viewed (0) -
internal/lsync/lrwmutex.go
return false default: if lm.lock(id, source, isWriteLock) { return true } time.Sleep(time.Duration(r.Float64() * float64(lockRetryInterval))) } } } // Unlock unlocks the write lock. // // It is a run-time error if lm is not locked on entry to Unlock. func (lm *LRWMutex) Unlock() { isWriteLock := true success := lm.unlock(isWriteLock)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 4.8K bytes - Viewed (0) -
tests/customize_field_test.go
package tests_test import ( "testing" "time" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestCustomizeColumn(t *testing.T) { type CustomizeColumn struct { ID int64 `gorm:"column:mapped_id; primary_key:yes"` Name string `gorm:"column:mapped_name"` Date *time.Time `gorm:"column:mapped_time"` } DB.Migrator().DropTable(&CustomizeColumn{}) DB.AutoMigrate(&CustomizeColumn{})
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Sep 11 09:33:31 UTC 2020 - 6.9K bytes - Viewed (0) -
cmd/bucket-stats.go
avg := rl.UploadHistogram.GetAvgData() for k, v := range avg { // Convert nanoseconds to milliseconds ret[sizeTagToString(k)] = uint64(v.avg() / time.Millisecond) } return } // Update replication upload latency with a new value func (rl *ReplicationLatency) update(size int64, duration time.Duration) { rl.UploadHistogram.Add(size, duration) } // ReplicationLastMinute has last minute replication counters
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Sep 12 11:39:51 UTC 2024 - 13.4K bytes - Viewed (0) -
internal/grid/grid.go
// No need to read more... return b, nil } } } // getDeadline will truncate the deadline so it is at least 1ms and at most MaxDeadline. func getDeadline(d time.Duration) time.Duration { if d < time.Millisecond { return 0 } if d > MaxDeadline { return MaxDeadline } return d } type writerWrapper struct { ch chan<- []byte ctx context.Context }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 6.9K bytes - Viewed (0) -
cmd/update-notifier.go
// difference between newer and current release. t := time.Time{} newerThan := humanize.RelTime(t, t.Add(older), "before the latest release", "") if globalServerCtxt.JSON { return fmt.Sprintf("You are running an older version of MinIO released %s, update: %s", newerThan, downloadURL) } // Return the nicely colored and formatted update message.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Mar 09 03:07:08 UTC 2024 - 3.6K bytes - Viewed (0) -
cmd/data-scanner_test.go
obj := ObjectInfo{ Name: "foo", ModTime: time.Now().Add(-31 * 24 * time.Hour), Size: 100 << 20, VersionID: uuid.New().String(), IsLatest: true, NumVersions: 4, } delMarker := ObjectInfo{ Name: "foo-deleted", ModTime: time.Now().Add(-61 * 24 * time.Hour), Size: 0, VersionID: uuid.New().String(), IsLatest: true,
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 03 11:18:58 UTC 2024 - 6.9K bytes - Viewed (0) -
internal/http/response-recorder.go
StatusCode int // Log body of 4xx or 5xx responses LogErrBody bool // Log body of all responses LogAllBody bool ttfbHeader time.Duration ttfbBody time.Duration StartTime time.Time // number of bytes written bytesWritten int // number of bytes of response headers written headerBytesWritten int // Internal recording buffer headers bytes.Buffer body bytes.Buffer
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Sep 24 17:13:00 UTC 2024 - 5.5K bytes - Viewed (0) -
cmd/site-replication-utils.go
r := rand.New(rand.NewSource(time.Now().UnixNano())) // Run the site resync metrics load in a loop for { if err := sm.load(ctx, newObjectLayerFn()); err == nil { <-ctx.Done() return } duration := time.Duration(r.Float64() * float64(time.Second*10)) if duration < time.Second { // Make sure to sleep at least a second to avoid high CPU ticks. duration = time.Second } time.Sleep(duration) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 8.9K bytes - Viewed (0)