Fluctuations of non-ergodic stochastic processes