Fitting values in a vector to separate Onlinestats Univariate statistics

My final goal was to compute N separate Means after vectorizing a CircularBuffer Matrix and update the means after a certain number of steps of the Circular buffer. I know how to get separate calculations using LinearAlgebra.eachrow or LinearAlgebra.eachcol from a Matrix, but it appears that this solution doesn’t work for Matrix with dimensions (n,1)

using OnlineStats, LinearAlgebra, DataStructures

mat = rand(10,5)
resh = reshape(mat, (size(mat,1) * size(mat,2), 1))
g = length(resh) * Mean()
fit!(g, LinearAlgebra.eachrow(resh))

In this example, the Means() end up taking 50 inputs each instead of 1

For anyone interested, the solution I found was to pass a view on the first row and all columns of the matrix, instead of LinearAlgebra.eachrow

mat = rand(10,5)
resh = reshape(mat, (size(mat,1) * size(mat,2), 1))
g = length(resh) * Mean()
fit!(g, view(resh, :, 1))