We consider a BMAP/G/1 type queueing model with gated service and duration of vacations depending on how many times in turn the system was empty at the previous vacation completion moments. We compute stationary distributions of the queue length at the embedded moments (vacation completions) and at arbitrary time as well as of a customer waiting time. The results of our analysis can be useful for determining strategy of adaptive choosing duration of sleep periods, e.g., in mobile networks where power consumption is an important issue.