The concept of a statistical ensemble, which leads to the partition function that would allow one to deduce all thermodynamic properties of a system, in principle, was most certainly introduced by J. W. Gibbs as indicated by Peter above.
To complete the picture, one should also remember contributions of J.K.Maxwell.(Maxwell gas).After reading Maxwell, it is not too difficult to think the way Gibbs was thinking.