diff options
Diffstat (limited to 'internal/cache/size.go')
-rw-r--r-- | internal/cache/size.go | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/internal/cache/size.go b/internal/cache/size.go index 83b0da046..9c1a82abc 100644 --- a/internal/cache/size.go +++ b/internal/cache/size.go @@ -176,6 +176,7 @@ func totalOfRatios() float64 { config.GetCacheBlockMemRatio() + config.GetCacheBlockIDsMemRatio() + config.GetCacheBoostOfIDsMemRatio() + + config.GetCacheClientMemRatio() + config.GetCacheEmojiMemRatio() + config.GetCacheEmojiCategoryMemRatio() + config.GetCacheFollowMemRatio() + @@ -198,6 +199,7 @@ func totalOfRatios() float64 { config.GetCacheStatusFaveIDsMemRatio() + config.GetCacheTagMemRatio() + config.GetCacheThreadMuteMemRatio() + + config.GetCacheTokenMemRatio() + config.GetCacheTombstoneMemRatio() + config.GetCacheUserMemRatio() + config.GetCacheWebfingerMemRatio() + @@ -287,6 +289,17 @@ func sizeofBlock() uintptr { })) } +func sizeofClient() uintptr { + return uintptr(size.Of(>smodel.Client{ + ID: exampleID, + CreatedAt: exampleTime, + UpdatedAt: exampleTime, + Secret: exampleID, + Domain: exampleURI, + UserID: exampleID, + })) +} + func sizeofEmoji() uintptr { return uintptr(size.Of(>smodel.Emoji{ ID: exampleID, @@ -591,7 +604,7 @@ func sizeofTag() uintptr { })) } -func sizeOfThreadMute() uintptr { +func sizeofThreadMute() uintptr { return uintptr(size.Of(>smodel.ThreadMute{ ID: exampleID, CreatedAt: exampleTime, @@ -601,6 +614,29 @@ func sizeOfThreadMute() uintptr { })) } +func sizeofToken() uintptr { + return uintptr(size.Of(>smodel.Token{ + ID: exampleID, + CreatedAt: exampleTime, + UpdatedAt: exampleTime, + ClientID: exampleID, + UserID: exampleID, + RedirectURI: exampleURI, + Scope: "r:w", + Code: "", // TODO + CodeChallenge: "", // TODO + CodeChallengeMethod: "", // TODO + CodeCreateAt: exampleTime, + CodeExpiresAt: exampleTime, + Access: exampleID + exampleID, + AccessCreateAt: exampleTime, + AccessExpiresAt: exampleTime, + Refresh: "", // TODO: clients don't really support this very well yet + RefreshCreateAt: exampleTime, + RefreshExpiresAt: exampleTime, + })) +} + func sizeofTombstone() uintptr { return uintptr(size.Of(>smodel.Tombstone{ ID: exampleID, |